Skip to content

Commit

Permalink
SUNRPC: Never reuse the socket port after an xs_close()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 22, 2011
1 parent b8413f9 commit 246408d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 246408d

Please sign in to comment.