]> git.karo-electronics.de Git - linux-beck.git/commitdiff
SUNRPC: Never reuse the socket port after an xs_close()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 22 Mar 2011 22:40:10 +0000 (18:40 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 22 Mar 2011 22:42:33 +0000 (18:42 -0400)
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
net/sunrpc/xprtsock.c

index be96d429b475f72c31f5d16a0b9e28d677d969b9..1e336a06d3e6375af0221b5a65f9db7236c2c4a0 100644 (file)
@@ -710,6 +710,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;