]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Mar 2011 18:30:50 +0000 (11:30 -0700)
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 <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/xprtsock.c

index b6fcf68dc35cdd3a2fd08942151c5771338f05cb..d270403563688d06e89010c5c2d1a7a8f142fdb5 100644 (file)
@@ -743,6 +743,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;