diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-08-09 15:09:35 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:09:35 -0400 |
commit | ba809130bc260fce04141aca01ef9e068d32af2a (patch) | |
tree | 8aa5fe3f46c679346120f2c28848bf4446133a4c /net/sunrpc/xprtsock.c | |
parent | a02d692611348f11ee1bc37431a883c3ff2de23e (diff) |
SUNRPC: Remove duplicate universal address generation
RPC universal address generation is currently done in several places:
rpcb_clnt.c, nfs4proc.c xprtsock.c, and xprtrdma.c. Remove the
redundant cases that convert a socket address to a universal
address. The nfs4proc.c case takes a pre-formatted presentation
address string, not a socket address, so we'll leave that one.
Because the new uaddr constructor uses the recently introduced
rpc_ntop(), it now supports proper "::" shorthanding for IPv6
addresses. This allows the kernel to register properly formed
universal addresses with the local rpcbind service, in _all_ cases.
The kernel can now also send properly formed universal addresses in
RPCB_GETADDR requests, and support link-local properly when
encoding and decoding IPv6 addresses.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 83c73c4d017a..a42c2adda59f 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -341,15 +341,6 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
341 | } | 341 | } |
342 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; | 342 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; |
343 | 343 | ||
344 | buf = kzalloc(30, GFP_KERNEL); | ||
345 | if (buf) { | ||
346 | snprintf(buf, 30, "%pI4.%u.%u", | ||
347 | &addr->sin_addr.s_addr, | ||
348 | ntohs(addr->sin_port) >> 8, | ||
349 | ntohs(addr->sin_port) & 0xff); | ||
350 | } | ||
351 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | ||
352 | |||
353 | xprt->address_strings[RPC_DISPLAY_NETID] = netid; | 344 | xprt->address_strings[RPC_DISPLAY_NETID] = netid; |
354 | } | 345 | } |
355 | 346 | ||
@@ -397,15 +388,6 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
397 | } | 388 | } |
398 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; | 389 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; |
399 | 390 | ||
400 | buf = kzalloc(50, GFP_KERNEL); | ||
401 | if (buf) { | ||
402 | snprintf(buf, 50, "%pI6.%u.%u", | ||
403 | &addr->sin6_addr, | ||
404 | ntohs(addr->sin6_port) >> 8, | ||
405 | ntohs(addr->sin6_port) & 0xff); | ||
406 | } | ||
407 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | ||
408 | |||
409 | xprt->address_strings[RPC_DISPLAY_NETID] = netid; | 391 | xprt->address_strings[RPC_DISPLAY_NETID] = netid; |
410 | } | 392 | } |
411 | 393 | ||