diff options
author | Olga Kornievskaia <kolga@netapp.com> | 2021-06-23 23:28:48 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-07-08 14:03:24 -0400 |
commit | a8482488a7d6d320f63a9ee1912dbb5ae5b80a61 (patch) | |
tree | 3f3a8b81e1df1cde26b865f10fe48c2652c084da /net | |
parent | 0e65ea43d9c7c038e167b20165a0e9ed1e9cca83 (diff) | |
download | linux-stable-a8482488a7d6d320f63a9ee1912dbb5ae5b80a61.tar.gz linux-stable-a8482488a7d6d320f63a9ee1912dbb5ae5b80a61.tar.bz2 linux-stable-a8482488a7d6d320f63a9ee1912dbb5ae5b80a61.zip |
SUNRPC query transport's source port
Provide ability to query transport's source port.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtsock.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 2ad4d0df45fe..4611845ec1eb 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1653,6 +1653,13 @@ static int xs_get_srcport(struct sock_xprt *transport) return port; } +unsigned short get_srcport(struct rpc_xprt *xprt) +{ + struct sock_xprt *sock = container_of(xprt, struct sock_xprt, xprt); + return sock->srcport; +} +EXPORT_SYMBOL(get_srcport); + static unsigned short xs_next_srcport(struct sock_xprt *transport, unsigned short port) { if (transport->srcport != 0) |