All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [RFC PATCH 1/5] mptcp: clear 'is_tcp' socket flag when the MP_CAPABLE handshake fails
@ 2019-12-06 12:22 Paolo Abeni
  0 siblings, 0 replies; only message in thread
From: Paolo Abeni @ 2019-12-06 12:22 UTC (permalink / raw)
  To: mptcp

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

Currently we don't have a single flag for 'mp capable handshake
failed', but we can clear the is_tcp flag to record such info.

This will make also processing for fallback socket almost as fast
as native ones, and will help cleaning 'fallback' fields usage
in later patches.

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/options.c | 3 +++
 net/mptcp/subflow.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index f7ad22236ed9..eabeea11a90e 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -301,6 +301,8 @@ void mptcp_rcv_synsent(struct sock *sk)
 		subflow->mp_capable = 1;
 		subflow->can_ack = 1;
 		subflow->remote_key = tp->rx_opt.mptcp.sndr_key;
+	} else {
+		tcp_sk(sk)->is_mptcp = 0;
 	}
 }
 
@@ -505,6 +507,7 @@ static bool check_fourth_ack(struct mptcp_subflow_context *subflow,
 	 */
 	if (!mp_opt->mp_capable) {
 		subflow->mp_capable = 0;
+		tcp_sk(mptcp_subflow_tcp_socket(subflow)->sk)->is_mptcp = 0;
 		return false;
 	}
 	subflow->remote_key = mp_opt->sndr_key;
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 3a055e8e918e..03c9e52d376b 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -699,6 +699,8 @@ static void subflow_ulp_clone(const struct request_sock *req,
 		new_ctx->token = subflow_req->token;
 		new_ctx->ssn_offset = subflow_req->ssn_offset;
 		new_ctx->idsn = subflow_req->idsn;
+	} else {
+		tcp_sk(newsk)->is_mptcp = 0;
 	}
 }
 
-- 
2.21.0

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

only message in thread, other threads:[~2019-12-06 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 12:22 [MPTCP] [RFC PATCH 1/5] mptcp: clear 'is_tcp' socket flag when the MP_CAPABLE handshake fails 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.