linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] mptcp: fix joined subflows with unblocking sk
@ 2020-07-27 10:24 Matthieu Baerts
  2020-07-27 10:38 ` Paolo Abeni
  2020-07-27 18:52 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts @ 2020-07-27 10:24 UTC (permalink / raw)
  To: netdev
  Cc: Matthieu Baerts, Mat Martineau, David S. Miller, Jakub Kicinski,
	Paolo Abeni, mptcp, linux-kernel

Unblocking sockets used for outgoing connections were not containing
inet info about the initial connection due to a typo there: the value of
"err" variable is negative in the kernelspace.

This fixes the creation of additional subflows where the remote port has
to be reused if the other host didn't announce another one. This also
fixes inet_diag showing blank info about MPTCP sockets from unblocking
sockets doing a connect().

Fixes: 41be81a8d3d0 ("mptcp: fix unblocking connect()")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 3980fbb6f31e..c0abe738e7d3 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1833,7 +1833,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 	/* on successful connect, the msk state will be moved to established by
 	 * subflow_finish_connect()
 	 */
-	if (!err || err == EINPROGRESS)
+	if (!err || err == -EINPROGRESS)
 		mptcp_copy_inaddrs(sock->sk, ssock->sk);
 	else
 		inet_sk_state_store(sock->sk, inet_sk_state_load(ssock->sk));
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] mptcp: fix joined subflows with unblocking sk
  2020-07-27 10:24 [PATCH net] mptcp: fix joined subflows with unblocking sk Matthieu Baerts
@ 2020-07-27 10:38 ` Paolo Abeni
  2020-07-27 18:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2020-07-27 10:38 UTC (permalink / raw)
  To: Matthieu Baerts, netdev
  Cc: Mat Martineau, David S. Miller, Jakub Kicinski, mptcp, linux-kernel

On Mon, 2020-07-27 at 12:24 +0200, Matthieu Baerts wrote:
> Unblocking sockets used for outgoing connections were not containing
> inet info about the initial connection due to a typo there: the value of
> "err" variable is negative in the kernelspace.
> 
> This fixes the creation of additional subflows where the remote port has
> to be reused if the other host didn't announce another one. This also
> fixes inet_diag showing blank info about MPTCP sockets from unblocking
> sockets doing a connect().
> 
> Fixes: 41be81a8d3d0 ("mptcp: fix unblocking connect()")
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Acked-by: Paolo Abeni <pabeni@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] mptcp: fix joined subflows with unblocking sk
  2020-07-27 10:24 [PATCH net] mptcp: fix joined subflows with unblocking sk Matthieu Baerts
  2020-07-27 10:38 ` Paolo Abeni
@ 2020-07-27 18:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-07-27 18:52 UTC (permalink / raw)
  To: matthieu.baerts
  Cc: netdev, mathew.j.martineau, kuba, pabeni, mptcp, linux-kernel

From: Matthieu Baerts <matthieu.baerts@tessares.net>
Date: Mon, 27 Jul 2020 12:24:33 +0200

> Unblocking sockets used for outgoing connections were not containing
> inet info about the initial connection due to a typo there: the value of
> "err" variable is negative in the kernelspace.
> 
> This fixes the creation of additional subflows where the remote port has
> to be reused if the other host didn't announce another one. This also
> fixes inet_diag showing blank info about MPTCP sockets from unblocking
> sockets doing a connect().
> 
> Fixes: 41be81a8d3d0 ("mptcp: fix unblocking connect()")
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-27 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 10:24 [PATCH net] mptcp: fix joined subflows with unblocking sk Matthieu Baerts
2020-07-27 10:38 ` Paolo Abeni
2020-07-27 18:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).