From: Brian Haley <brian.haley@hp.com>
To: "Aurélien Charbon" <aurelien.charbon@ext.bull.net>
Cc: 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: Fri, 12 Oct 2007 12:07:46 -0400 [thread overview]
Message-ID: <470F9BD2.3070204@hp.com> (raw)
In-Reply-To: <470F3AF2.8000706@ext.bull.net>
Hi Aurelien,
There were some of my comments you haven't addressed yet, comments in-line.
Aurélien Charbon wrote:
> Here is a patch for the ip_map caching code part in nfs server.
> + for (i = 0; i < ncp->cl_naddr; i++) {
> + /* Mapping address */
> + ipv6_addr_v4map(ncp->cl_addrlist[i], addr6);
ipv6_addr_set(&addr6, 0, 0, htonl(0x0000FFFF), ncp->cl_addrlist[i]);
> + /* IPv6 address mapping */
> + ipv6_addr_v4map(sin->sin_addr, in6);
ipv6_addr_set(&in6, 0, 0, htonl(0x0000FFFF), sin->sin_addr);
> + /* IPv6 address mapping */
> + ipv6_addr_v4map(sin->sin_addr, in6);
ipv6_addr_set(&in6, 0, 0, htonl(0x0000FFFF), sin->sin_addr);
> +#define IS_ADDR_MAPPED(a) \
> + (((uint32_t *) (a))[0] == 0 \
> + && ((uint32_t *) (a))[1] == 0 \
> + && (((uint32_t *) (a))[2] == 0 \
> + || ((uint32_t *) (a))[2] == htonl(0xffff)))
This is unused, can go away.
> +static inline void ipv6_addr_v4map(const struct in_addr a1, struct
> in6_addr a2)
> +{
> + a2.s6_addr32[0] = 0;
> + a2.s6_addr32[1] = 0;
> + a2.s6_addr32[2] = htonl(0xffff);
> + a2.s6_addr32[3] = (uint32_t)a1.s_addr;
> +}
If you use ipv6_addr_set() everywhere you don't need this.
> static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
> {
> return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 &&
> - a->s6_addr32[2] == htonl(0x0000ffff));
> + a->s6_addr32[2] == htonl(0x0000ffff));
> }
Guessing you changed a tab to a space, unnecessary.
> -static struct ip_map *ip_map_lookup(char *class, struct in_addr addr);
> +static struct ip_map *ip_map_lookup(char *class, struct in6_addr addr);
I still think you should pass a pointer here.
> -int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom)
> +int auth_unix_add_addr(struct in6_addr addr, struct auth_domain *dom)
And here.
> -struct auth_domain *auth_unix_lookup(struct in_addr addr)
> +struct auth_domain *auth_unix_lookup(struct in6_addr addr)
And here.
-Brian
next prev parent reply other threads:[~2007-10-12 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 9:14 [PATCH 1/2] NFS: change the ip_map cache code to handle IPv6 addresses Aurélien Charbon
2007-10-12 16:07 ` Brian Haley [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-23 7:22 Aurélien Charbon
2007-10-30 17:05 Aurélien Charbon
2007-10-30 18:49 ` J. Bruce Fields
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=470F9BD2.3070204@hp.com \
--to=brian.haley@hp.com \
--cc=aurelien.charbon@ext.bull.net \
--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 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.