mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
sunrpc: Fix return value of get_srcport()
[ Upstream commit5d46dd04cb
] Sincebc1c56e9bb
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:bc1c56e9bb
(SUNRPC: prevent port reuse on transports which don't request it) Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2d0538a8cb
commit
c13449c61f
1 changed files with 1 additions and 1 deletions
|
@ -1656,7 +1656,7 @@ static int xs_get_srcport(struct sock_xprt *transport)
|
|||
unsigned short get_srcport(struct rpc_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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue