diff options
-rw-r--r-- | include/linux/sunrpc/xprt.h | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index d11cedd14f0f..4596c26f97aa 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -53,6 +53,8 @@ enum rpc_display_format_t { | |||
53 | RPC_DISPLAY_PORT, | 53 | RPC_DISPLAY_PORT, |
54 | RPC_DISPLAY_PROTO, | 54 | RPC_DISPLAY_PROTO, |
55 | RPC_DISPLAY_ALL, | 55 | RPC_DISPLAY_ALL, |
56 | RPC_DISPLAY_HEX_ADDR, | ||
57 | RPC_DISPLAY_HEX_PORT, | ||
56 | RPC_DISPLAY_MAX, | 58 | RPC_DISPLAY_MAX, |
57 | }; | 59 | }; |
58 | 60 | ||
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index b3f40b8dbcba..8a684d873111 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -296,6 +296,20 @@ static void xs_format_peer_addresses(struct rpc_xprt *xprt) | |||
296 | xprt->prot == IPPROTO_UDP ? "udp" : "tcp"); | 296 | xprt->prot == IPPROTO_UDP ? "udp" : "tcp"); |
297 | } | 297 | } |
298 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; | 298 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; |
299 | |||
300 | buf = kzalloc(10, GFP_KERNEL); | ||
301 | if (buf) { | ||
302 | snprintf(buf, 10, "%02x%02x%02x%02x", | ||
303 | NIPQUAD(addr->sin_addr.s_addr)); | ||
304 | } | ||
305 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; | ||
306 | |||
307 | buf = kzalloc(8, GFP_KERNEL); | ||
308 | if (buf) { | ||
309 | snprintf(buf, 8, "%4hx", | ||
310 | ntohs(addr->sin_port)); | ||
311 | } | ||
312 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; | ||
299 | } | 313 | } |
300 | 314 | ||
301 | static void xs_free_peer_addresses(struct rpc_xprt *xprt) | 315 | static void xs_free_peer_addresses(struct rpc_xprt *xprt) |