From: Trond Myklebust Date: Tue, 22 Mar 2011 22:40:10 +0000 (-0400) Subject: SUNRPC: Never reuse the socket port after an xs_close() X-Git-Tag: v2.6.34.10~41 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5c524f81c44422657fd7c9a1d4e32c7bf2248a04;p=karo-tx-linux.git SUNRPC: Never reuse the socket port after an xs_close() commit 246408dcd5dfeef2df437ccb0ef4d6ee87805f58 upstream. 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 Signed-off-by: Paul Gortmaker --- diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 054d735835e7..b613cb73dcf2 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -724,6 +724,8 @@ static void xs_reset_transport(struct sock_xprt *transport) if (sk == NULL) return; + transport->srcport = 0; + write_lock_bh(&sk->sk_callback_lock); transport->inet = NULL; transport->sock = NULL;