Netdev List
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Geliang Tang <geliang.tang@suse.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	matthieu.baerts@tessares.net, mptcp@lists.linux.dev,
	Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH net-next 1/8] mptcp: don't send RST for single subflow
Date: Fri, 22 Apr 2022 14:55:36 -0700	[thread overview]
Message-ID: <20220422215543.545732-2-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: <20220422215543.545732-1-mathew.j.martineau@linux.intel.com>

From: Geliang Tang <geliang.tang@suse.com>

When a bad checksum is detected and a single subflow is in use, don't
send RST + MP_FAIL, send data_ack + MP_FAIL instead.

So invoke tcp_send_active_reset() only when mptcp_has_another_subflow()
is true.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 net/mptcp/subflow.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index aba260f547da..f217926f6a9c 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1206,14 +1206,14 @@ static bool subflow_check_data_avail(struct sock *ssk)
 	/* RFC 8684 section 3.7. */
 	if (subflow->send_mp_fail) {
 		if (mptcp_has_another_subflow(ssk)) {
+			ssk->sk_err = EBADMSG;
+			tcp_set_state(ssk, TCP_CLOSE);
+			subflow->reset_transient = 0;
+			subflow->reset_reason = MPTCP_RST_EMIDDLEBOX;
+			tcp_send_active_reset(ssk, GFP_ATOMIC);
 			while ((skb = skb_peek(&ssk->sk_receive_queue)))
 				sk_eat_skb(ssk, skb);
 		}
-		ssk->sk_err = EBADMSG;
-		tcp_set_state(ssk, TCP_CLOSE);
-		subflow->reset_transient = 0;
-		subflow->reset_reason = MPTCP_RST_EMIDDLEBOX;
-		tcp_send_active_reset(ssk, GFP_ATOMIC);
 		WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
 		return true;
 	}
-- 
2.36.0


  reply	other threads:[~2022-04-22 22:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 21:55 [PATCH net-next 0/8] mptcp: TCP fallback for established connections Mat Martineau
2022-04-22 21:55 ` Mat Martineau [this message]
2022-04-22 21:55 ` [PATCH net-next 2/8] mptcp: add the fallback check Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 3/8] mptcp: track and update contiguous data status Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 4/8] mptcp: infinite mapping sending Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 5/8] mptcp: infinite mapping receiving Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 6/8] mptcp: add mib for infinite map sending Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 7/8] mptcp: dump infinite_map field in mptcp_dump_mpext Mat Martineau
2022-04-22 21:55 ` [PATCH net-next 8/8] selftests: mptcp: add infinite map mibs check Mat Martineau
2022-04-23 11:00 ` [PATCH net-next 0/8] mptcp: TCP fallback for established connections patchwork-bot+netdevbpf

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=20220422215543.545732-2-mathew.j.martineau@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=geliang.tang@suse.com \
    --cc=kuba@kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox