netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: "Aurélien Charbon" <aurelien.charbon@ext.bull.net>
Cc: Neil Brown <neilb@suse.de>,
	Mailing list NFSv4 <nfsv4@linux-nfs.org>,
	netdev ML <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] NFS: change the ip_map cache code to handle IPv6 addresses
Date: Tue, 30 Oct 2007 14:49:01 -0400	[thread overview]
Message-ID: <20071030184901.GJ21595@fieldses.org> (raw)
In-Reply-To: <47276466.4000402@ext.bull.net>

Thanks for working on this.

Could you run linux/scripts/checkpatch.pl on your patch and fix the
problems it complains about?

On Tue, Oct 30, 2007 at 06:05:42PM +0100, Aurélien Charbon wrote:
> static void update(struct cache_head *cnew, struct cache_head *citem)
> {
> @@ -149,22 +157,24 @@ static void ip_map_request(struct cache_
>                   struct cache_head *h,
>                   char **bpp, int *blen)
> {
> -    char text_addr[20];
> +    char text_addr[40];
>     struct ip_map *im = container_of(h, struct ip_map, h);
> -    __be32 addr = im->m_addr.s_addr;
> -
> -    snprintf(text_addr, 20, "%u.%u.%u.%u",
> -         ntohl(addr) >> 24 & 0xff,
> -         ntohl(addr) >> 16 & 0xff,
> -         ntohl(addr) >>  8 & 0xff,
> -         ntohl(addr) >>  0 & 0xff);
> +    if (ipv6_addr_v4mapped(&(im->m_addr))) {
> +        snprintf(text_addr, 20, NIPQUAD_FMT,
> +                ntohl(im->m_addr.s6_addr32[3]) >> 24 & 0xff,
> +                ntohl(im->m_addr.s6_addr32[3]) >> 16 & 0xff,
> +                ntohl(im->m_addr.s6_addr32[3]) >>  8 & 0xff,
> +                ntohl(im->m_addr.s6_addr32[3]) >>  0 & 0xff);
> +    } else {
> +        snprintf(text_addr, 40, NIP6_FMT, NIP6(im->m_addr));
> +    }
>     qword_add(bpp, blen, im->m_class);
>     qword_add(bpp, blen, text_addr);
>     (*bpp)[-1] = '\n';
> }

What happens when an unpatched mountd gets this request?  Does it
ignore it, or respond with a negative entry?

--b.

  reply	other threads:[~2007-10-30 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 17:05 [PATCH 1/2] NFS: change the ip_map cache code to handle IPv6 addresses Aurélien Charbon
2007-10-30 18:49 ` J. Bruce Fields [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-22 11:27 Aurélien Charbon
2007-10-24 19:22 ` Brian Haley
2007-10-12  9:14 Aurélien Charbon
2007-10-12 16:07 ` Brian Haley

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=20071030184901.GJ21595@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=aurelien.charbon@ext.bull.net \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    /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).