浏览代码

SUNRPC: Never reuse the socket port after an xs_close()

If we call xs_close(), we're in one of two situations:
 - Autoclose, which means we don't expect to resend a request
 - bind+connect failed, which probably means the port is in use

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
Trond Myklebust 14 年之前
父节点
当前提交
246408dcd5
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/sunrpc/xprtsock.c

+ 2 - 0
net/sunrpc/xprtsock.c

@@ -710,6 +710,8 @@ static void xs_reset_transport(struct sock_xprt *transport)
 	if (sk == NULL)
 	if (sk == NULL)
 		return;
 		return;
 
 
+	transport->srcport = 0;
+
 	write_lock_bh(&sk->sk_callback_lock);
 	write_lock_bh(&sk->sk_callback_lock);
 	transport->inet = NULL;
 	transport->inet = NULL;
 	transport->sock = NULL;
 	transport->sock = NULL;