Commit 5d46dd04 authored by Anna Schumaker's avatar Anna Schumaker

sunrpc: Fix return value of get_srcport()

Since bc1c56e9 transport->srcport may by unset, causing
get_srcport() to return 0 when called. Fix this by querying the port
from the underlying socket instead of the transport.

Fixes: bc1c56e9 (SUNRPC: prevent port reuse on transports which don't request it)
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent f99fa508
...@@ -1656,7 +1656,7 @@ static int xs_get_srcport(struct sock_xprt *transport) ...@@ -1656,7 +1656,7 @@ static int xs_get_srcport(struct sock_xprt *transport)
unsigned short get_srcport(struct rpc_xprt *xprt) unsigned short get_srcport(struct rpc_xprt *xprt)
{ {
struct sock_xprt *sock = container_of(xprt, struct sock_xprt, xprt); struct sock_xprt *sock = container_of(xprt, struct sock_xprt, xprt);
return sock->srcport; return xs_sock_getport(sock->sock);
} }
EXPORT_SYMBOL(get_srcport); EXPORT_SYMBOL(get_srcport);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment