All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Chuck Lever <chuck.lever@oracle.com>, Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/3] Make buffers large enough for IPv6 addresses
Date: Wed, 04 Aug 2010 16:49:45 +1000	[thread overview]
Message-ID: <20100804064945.16641.40216.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100804064553.16641.92857.stgit@localhost.localdomain>

Each of these buffers is use to hold the presentation format for an
address which could be either IPv4 or IPv6, so make the buffers large
enough for either.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 support/export/hostname.c |    2 +-
 utils/mountd/cache.c      |    6 +++---
 utils/mountd/rmtab.c      |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/support/export/hostname.c b/support/export/hostname.c
index 232e040..f6a59f1 100644
--- a/support/export/hostname.c
+++ b/support/export/hostname.c
@@ -299,7 +299,7 @@ struct addrinfo *
 host_numeric_addrinfo(const struct sockaddr *sap)
 {
 	socklen_t salen = sockaddr_size(sap);
-	char buf[INET_ADDRSTRLEN];
+	char buf[INET6_ADDRSTRLEN];
 	struct addrinfo *ai;
 	int error;
 
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index bf18a9a..736668e 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -75,7 +75,7 @@ void auth_unix_ip(FILE *f)
 	 */
 	char *cp;
 	char class[20];
-	char ipaddr[20];
+	char ipaddr[INET6_ADDRSTRLEN];
 	char *client = NULL;
 	struct addrinfo *tmp = NULL;
 	struct addrinfo *ai = NULL;
@@ -90,7 +90,7 @@ void auth_unix_ip(FILE *f)
 	    strcmp(class, "nfsd") != 0)
 		return;
 
-	if (qword_get(&cp, ipaddr, 20) <= 0)
+	if (qword_get(&cp, ipaddr, sizeof(ipaddr)) <= 0)
 		return;
 
 	tmp = host_pton(ipaddr);
@@ -920,7 +920,7 @@ int cache_export_ent(char *domain, struct exportent *exp, char *path)
 
 int cache_export(nfs_export *exp, char *path)
 {
-	char buf[INET_ADDRSTRLEN];
+	char buf[INET6_ADDRSTRLEN];
 	int err;
 	FILE *f;
 
diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c
index ba0fcf6..d86b0db 100644
--- a/utils/mountd/rmtab.c
+++ b/utils/mountd/rmtab.c
@@ -143,7 +143,7 @@ mountlist_del_all(struct sockaddr_in *sin)
 		return;
 	hostname = host_canonname((struct sockaddr *)sin);
 	if (hostname == NULL) {
-		char buf[INET_ADDRSTRLEN];
+		char buf[INET6_ADDRSTRLEN];
 		xlog(L_ERROR, "can't get hostname of %s",
 			host_ntop((struct sockaddr *)sin, buf, sizeof(buf)));
 		goto out_unlock;



  parent reply	other threads:[~2010-08-04  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04  6:49 [PATCH 0/3] Some IPv6 enhancements for nfs-utils Neil Brown
2010-08-04  6:49 ` [PATCH 3/3] Allow check_fqdn to compare IPv6 addresses Neil Brown
2010-09-27 11:46   ` Steve Dickson
2010-08-04  6:49 ` [PATCH 2/3] Give hostname.c more support for IPv6 Neil Brown
2010-08-04 11:57   ` Jim Rees
2010-09-27 11:44   ` Steve Dickson
2010-08-04  6:49 ` Neil Brown [this message]
2010-09-27 11:33   ` [PATCH 1/3] Make buffers large enough for IPv6 addresses Steve Dickson
2010-08-04 15:08 ` [PATCH 0/3] Some IPv6 enhancements for nfs-utils Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100804064945.16641.40216.stgit@localhost.localdomain \
    --to=neilb@suse.de \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.