mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 06:46:35 +01:00
SUNRPC query transport's source port
Provide ability to query transport's source port. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
This commit is contained in:
1 parent
0e65ea43d9
commit
a8482488a7
2 files changed
+8
No files matched your search
@@ -10,6 +10,7 @@
|
||||
|
||||
int init_socket_xprt(void);
|
||||
void cleanup_socket_xprt(void);
|
||||
unsigned short get_srcport(struct rpc_xprt *);
|
||||
|
||||
#define RPC_MIN_RESVPORT (1U)
|
||||
#define RPC_MAX_RESVPORT (65535U)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user