diff options
-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 cc7250d4659b..0fa1086cf991 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 " |