All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH v2 2/7] Squash-to "mptcp: Create SUBFLOW socket for incoming connection"
@ 2020-01-09 16:41 Paolo Abeni
  0 siblings, 0 replies; only message in thread
From: Paolo Abeni @ 2020-01-09 16:41 UTC (permalink / raw
  To: mptcp 

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

use is_mptcp instead of 'subflow->mp_capable'

v1 -> v2:
 - use sk_is_mptcp() in mptcp_accept() - Mat
---
 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 88bfa4fedde5..ec792dbe0a5b 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, sk_is_mptcp(newsk));
 
-	if (subflow->mp_capable) {
+	if (sk_is_mptcp(newsk)) {
+		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-09 16:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-09 16:41 [MPTCP] [PATCH v2 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.