diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 51f07c9a751b..3e8893001479 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -921,6 +921,18 @@ static void xs_udp_timer(struct rpc_task *task) | |||
921 | xprt_adjust_cwnd(task, -ETIMEDOUT); | 921 | xprt_adjust_cwnd(task, -ETIMEDOUT); |
922 | } | 922 | } |
923 | 923 | ||
924 | /** | ||
925 | * xs_set_port - reset the port number in the remote endpoint address | ||
926 | * @xprt: generic transport | ||
927 | * @port: new port number | ||
928 | * | ||
929 | */ | ||
930 | static void xs_set_port(struct rpc_xprt *xprt, unsigned short port) | ||
931 | { | ||
932 | dprintk("RPC: setting port for xprt %p to %u\n", xprt, port); | ||
933 | xprt->addr.sin_port = htons(port); | ||
934 | } | ||
935 | |||
924 | static int xs_bindresvport(struct rpc_xprt *xprt, struct socket *sock) | 936 | static int xs_bindresvport(struct rpc_xprt *xprt, struct socket *sock) |
925 | { | 937 | { |
926 | struct sockaddr_in myaddr = { | 938 | struct sockaddr_in myaddr = { |
@@ -1161,6 +1173,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
1161 | .set_buffer_size = xs_udp_set_buffer_size, | 1173 | .set_buffer_size = xs_udp_set_buffer_size, |
1162 | .reserve_xprt = xprt_reserve_xprt_cong, | 1174 | .reserve_xprt = xprt_reserve_xprt_cong, |
1163 | .release_xprt = xprt_release_xprt_cong, | 1175 | .release_xprt = xprt_release_xprt_cong, |
1176 | .set_port = xs_set_port, | ||
1164 | .connect = xs_connect, | 1177 | .connect = xs_connect, |
1165 | .buf_alloc = rpc_malloc, | 1178 | .buf_alloc = rpc_malloc, |
1166 | .buf_free = rpc_free, | 1179 | .buf_free = rpc_free, |
@@ -1175,6 +1188,7 @@ static struct rpc_xprt_ops xs_udp_ops = { | |||
1175 | static struct rpc_xprt_ops xs_tcp_ops = { | 1188 | static struct rpc_xprt_ops xs_tcp_ops = { |
1176 | .reserve_xprt = xprt_reserve_xprt, | 1189 | .reserve_xprt = xprt_reserve_xprt, |
1177 | .release_xprt = xprt_release_xprt, | 1190 | .release_xprt = xprt_release_xprt, |
1191 | .set_port = xs_set_port, | ||
1178 | .connect = xs_connect, | 1192 | .connect = xs_connect, |
1179 | .buf_alloc = rpc_malloc, | 1193 | .buf_alloc = rpc_malloc, |
1180 | .buf_free = rpc_free, | 1194 | .buf_free = rpc_free, |