Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1476883

[PATCH 4.7 005/143] SUNRPC: Handle EADDRNOTAVAIL on connection failures

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.7 005/143] SUNRPC: Handle EADDRNOTAVAIL on connection failures
Date 2016-09-05 19:50 +0200
Message-ID <se6bV-6U4-63@gated-at.bofh.it> (permalink)
References <se5fP-6h4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <trond.myklebust@primarydata.com>

commit 1f4c17a03ba7f430d63dba8c8e08ff1e2712581d upstream.

If the connect attempt immediately fails with an EADDRNOTAVAIL error, then
that means our choice of source port number was bad.
This error is expected when we set the SO_REUSEPORT socket option and we
have 2 sockets sharing the same source and destination address and port
combinations.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Fixes: 402e23b4ed9ed ("SUNRPC: Fix stupid typo in xs_sock_set_reuseport")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/xprtsock.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2278,6 +2278,10 @@ static int xs_tcp_finish_connecting(stru
 		/* SYN_SENT! */
 		if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
 			xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
+		break;
+	case -EADDRNOTAVAIL:
+		/* Source port number is unavailable. Try a new one! */
+		transport->srcport = 0;
 	}
 out:
 	return ret;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.7 000/143] 4.7.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-05 19:50 +0200
  [PATCH 4.7 005/143] SUNRPC: Handle EADDRNOTAVAIL on connection failures Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-05 19:50 +0200
  [PATCH 4.7 013/143] virtio: fix memory leak in virtqueue_add() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-05 19:50 +0200
  Re: [PATCH 4.7 000/143] 4.7.3-stable review Guenter Roeck <linux@roeck-us.net> - 2016-09-06 19:10 +0200
    Re: [PATCH 4.7 000/143] 4.7.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-07 08:30 +0200
  Re: [PATCH 4.7 000/143] 4.7.3-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-09-06 20:10 +0200
    Re: [PATCH 4.7 000/143] 4.7.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-07 08:30 +0200
  Re: [PATCH 4.7 000/143] 4.7.3-stable review "Levin, Alexander" <alexander.levin@verizon.com> - 2016-09-07 23:10 +0200
    Re: [PATCH 4.7 000/143] 4.7.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-08 09:00 +0200
      Re: [PATCH 4.7 000/143] 4.7.3-stable review Johannes Stezenbach <js@sig21.net> - 2016-09-08 13:00 +0200

csiph-web