All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH v1 2/7] Squash-to "mptcp: Create SUBFLOW socket for incoming connection"
@ 2020-01-08 14:47 Paolo Abeni
  0 siblings, 0 replies; only message in thread
From: Paolo Abeni @ 2020-01-08 14:47 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

use is_mptcp instead of 'subflow->mp_capable'
---
 net/mptcp/protocol.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 70e28cc0dbe0..283e7dc2d25e 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -243,7 +243,6 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
 				 bool kern)
 {
 	struct mptcp_sock *msk = mptcp_sk(sk);
-	struct mptcp_subflow_context *subflow;
 	struct socket *listener;
 	struct sock *newsk;
 
@@ -258,13 +257,14 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
 	if (!newsk)
 		return NULL;
 
-	subflow = mptcp_subflow_ctx(newsk);
-	pr_debug("msk=%p, new subflow=%p, ", msk, subflow);
+	pr_debug("msk=%p, subflow is mptcp=%d", msk, tcp_sk(newsk)->is_mptcp);
 
-	if (subflow->mp_capable) {
+	if (tcp_sk(newsk)->is_mptcp) {
+		struct mptcp_subflow_context *subflow;
 		struct sock *new_mptcp_sock;
 		struct sock *ssk = newsk;
 
+		subflow = mptcp_subflow_ctx(newsk);
 		lock_sock(sk);
 
 		local_bh_disable();
@@ -295,8 +295,6 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
 		bh_unlock_sock(new_mptcp_sock);
 		local_bh_enable();
 		release_sock(sk);
-	} else {
-		tcp_sk(newsk)->is_mptcp = 0;
 	}
 
 	return newsk;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-08 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 14:47 [MPTCP] [PATCH v1 2/7] Squash-to "mptcp: Create SUBFLOW socket for incoming connection" Paolo Abeni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.