diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-09-15 17:27:30 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-09-29 18:13:40 -0400 |
commit | 9d548b9c955c0709d1229d21d0bc14afa6b356de (patch) | |
tree | 99a742858c6ad53d4bc790aa096561f18c97a5b0 /net | |
parent | 2c7eb0b206b8408d92c518033a359f4374c75314 (diff) |
SUNRPC: Use short-hand IPv6 ANYADDR for RPCB_SET
Clean up: When doing an RPCB_SET, make the kernel's rpcb client use the
shorthand "::" for the universal form of the IPv6 ANY address.
Without this patch, rpcbind will advertise:
0000:0000:0000:0000:0000:0000:0000:0000.x.y
This is cosmetic only. It cleans up the display of information from
/sbin/rpcinfo.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index cc7250d4659..0fa1086cf99 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/in6.h> | 20 | #include <linux/in6.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <net/ipv6.h> | ||
23 | 24 | ||
24 | #include <linux/sunrpc/clnt.h> | 25 | #include <linux/sunrpc/clnt.h> |
25 | #include <linux/sunrpc/sched.h> | 26 | #include <linux/sunrpc/sched.h> |
@@ -304,10 +305,13 @@ static int rpcb_register_netid6(struct sockaddr_in6 *address_to_register, | |||
304 | char buf[64]; | 305 | char buf[64]; |
305 | 306 | ||
306 | /* Construct AF_INET6 universal address */ | 307 | /* Construct AF_INET6 universal address */ |
307 | snprintf(buf, sizeof(buf), | 308 | if (ipv6_addr_any(&address_to_register->sin6_addr)) |
308 | NIP6_FMT".%u.%u", | 309 | snprintf(buf, sizeof(buf), "::.%u.%u", |
309 | NIP6(address_to_register->sin6_addr), | 310 | port >> 8, port & 0xff); |
310 | port >> 8, port & 0xff); | 311 | else |
312 | snprintf(buf, sizeof(buf), NIP6_FMT".%u.%u", | ||
313 | NIP6(address_to_register->sin6_addr), | ||
314 | port >> 8, port & 0xff); | ||
311 | map->r_addr = buf; | 315 | map->r_addr = buf; |
312 | 316 | ||
313 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " | 317 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " |