linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Neil Brown <neilb@suse.de>
Cc: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/3] Make buffers large enough for IPv6 addresses
Date: Mon, 27 Sep 2010 07:33:50 -0400	[thread overview]
Message-ID: <4CA0811E.3040906@RedHat.com> (raw)
In-Reply-To: <20100804064945.16641.40216.stgit@localhost.localdomain>



On 08/04/2010 02:49 AM, Neil Brown wrote:
> 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;
> 
> 
These size changes already exist due to commit d901e32

steved.

  reply	other threads:[~2010-09-27 11:33 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 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 ` [PATCH 1/3] Make buffers large enough for IPv6 addresses Neil Brown
2010-09-27 11:33   ` Steve Dickson [this message]
2010-08-04  6:49 ` [PATCH 3/3] Allow check_fqdn to compare " Neil Brown
2010-09-27 11:46   ` 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=4CA0811E.3040906@RedHat.com \
    --to=steved@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).