All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH v1 7/7] Squash-to: "mptcp: Add handling of incoming MP_JOIN requests"
@ 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: 1618 bytes --]

ensure fallback is fatal for MP_JOIN, copying with
changes introduced by previous squash-to patches

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/subflow.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 4e846b4e0b81..49d430479124 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -256,6 +256,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 	struct mptcp_subflow_context *listener = mptcp_subflow_ctx(sk);
 	struct mptcp_subflow_request_sock *subflow_req;
 	struct tcp_options_received opt_rx;
+	bool fallback_is_fatal = false;
 	struct sock *child;
 
 	pr_debug("listener=%p, req=%p, conn=%p", listener, req, listener->conn);
@@ -280,6 +281,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 			subflow_req->mp_capable = 0;
 		}
 	} else if (subflow_req->mp_join) {
+		fallback_is_fatal = true;
 		opt_rx.mptcp.mp_join = 0;
 		mptcp_get_options(skb, &opt_rx);
 		if (!opt_rx.mptcp.mp_join ||
@@ -294,11 +296,14 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 	if (child && *own_req) {
 		struct mptcp_subflow_context *ctx = mptcp_subflow_ctx(child);
 
-		/* we have null ctx on TCP fallback, not fatal on MPC
-		 * handshake
+		/* we have null ctx on TCP fallback, which is fatal on
+		 * MPJ handshake
 		 */
-		if (!ctx)
+		if (!ctx) {
+			if (fallback_is_fatal)
+				goto close_child;
 			return child;
+		}
 
 		if (ctx->mp_capable) {
 			if (mptcp_token_new_accept(ctx->token))
-- 
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 7/7] Squash-to: "mptcp: Add handling of incoming MP_JOIN requests" 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.