All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: mptcp@lists.linux.dev
Subject: [PATCH mptcp-next 2/2] Squash-to: "mptcp: move drop_other_suboptions check under pm lock"
Date: Wed, 11 Aug 2021 11:25:52 +0200	[thread overview]
Message-ID: <eb682dddcd1d3d1e486cbdab8e1e72b67d17d715.1628673891.git.pabeni@redhat.com> (raw)
In-Reply-To: <cover.1628673891.git.pabeni@redhat.com>

MPJ ACK is a pure TCP ack on an established TCP connection, so is
eligble to carry MPTCP ADD_ADDR option. If that happens, the MPJ
subopt will be stripped and the MPJ handshake will be broken.

Avoid adding ADD_ADDR subopt if the current packet is MPJ ACK (or
MPC ACK, just to be safe: the added check it's cheap).

This fixes issues/221

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/options.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index b2af81515f20..b3d5547fdb61 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -678,7 +678,11 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *
 	bool port;
 	int len;
 
+	/* add addr will strip the existing options, be sure to avoid breaking
+	 * MPC/MPJ handshakes
+	 */
 	if (!mptcp_pm_should_add_signal(msk) ||
+	    (opts->suboptions & (OPTION_MPTCP_MPJ_ACK | OPTION_MPTCP_MPC_ACK)) ||
 	    !mptcp_pm_add_addr_signal(msk, skb, opt_size, remaining, &opts->addr,
 		    &echo, &port, &drop_other_suboptions))
 		return false;
-- 
2.26.3


  parent reply	other threads:[~2021-08-11  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  9:25 [PATCH mptcp-next 0/2] mptcp: some self-tests fixup Paolo Abeni
2021-08-11  9:25 ` [PATCH mptcp-next 1/2] Squash-to: "selftests: mptcp: add testcase for active-back" Paolo Abeni
2021-08-11  9:25 ` Paolo Abeni [this message]
2021-08-11 15:36 ` [PATCH mptcp-next 0/2] mptcp: some self-tests fixup Matthieu Baerts
2021-08-11 17:24   ` Mat Martineau
2021-08-12  6:52 ` Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb682dddcd1d3d1e486cbdab8e1e72b67d17d715.1628673891.git.pabeni@redhat.com \
    --to=pabeni@redhat.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.