Skip to content

Commit 5d46dd0

Browse files
committed
sunrpc: Fix return value of get_srcport()
Since bc1c56e 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: bc1c56e (SUNRPC: prevent port reuse on transports which don't request it) Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent f99fa50 commit 5d46dd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/sunrpc/xprtsock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ static int xs_get_srcport(struct sock_xprt *transport)
16561656
unsigned short get_srcport(struct rpc_xprt *xprt)
16571657
{
16581658
struct sock_xprt *sock = container_of(xprt, struct sock_xprt, xprt);
1659-
return sock->srcport;
1659+
return xs_sock_getport(sock->sock);
16601660
}
16611661
EXPORT_SYMBOL(get_srcport);
16621662

0 commit comments

Comments
 (0)