All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <geliangtang@gmail.com>
Subject: [PATCH mptcp-next v3 5/8] mptcp: infinite mapping receiving
Date: Tue, 14 Sep 2021 17:19:04 +0800	[thread overview]
Message-ID: <27849702bc924bbab7ca914387e18b6dadfe5622.1631610729.git.geliangtang@gmail.com> (raw)
In-Reply-To: <cover.1631610729.git.geliangtang@gmail.com>

This patch added the infinite mapping receiving logic. When the infinite
mapping is received, set the map_data_len of the subflow to 0.

In subflow_check_data_avail, only reset the subflow when the map_data_len
of the subflow is non-zero.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/subflow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 89173f70707e..fd44996a7b9a 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -968,6 +968,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
 	data_len = mpext->data_len;
 	if (data_len == 0) {
 		MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
+		subflow->map_data_len = 0;
 		return MAPPING_INVALID;
 	}
 
@@ -1180,7 +1181,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
 			return true;
 		}
 
-		if (subflow->mp_join || subflow->fully_established) {
+		if ((subflow->mp_join || subflow->fully_established) && subflow->map_data_len) {
 			/* fatal protocol error, close the socket.
 			 * subflow_error_report() will introduce the appropriate barriers
 			 */
-- 
2.31.1


  parent reply	other threads:[~2021-09-14  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14  9:18 [PATCH mptcp-next v3 0/8] The infinite mapping support Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 1/8] mptcp: add mptcp_is_data_contiguous helper Geliang Tang
2021-09-14 15:32   ` Paolo Abeni
2021-09-15  0:37     ` Mat Martineau
2021-09-14  9:19 ` [PATCH mptcp-next v3 2/8] mptcp: add start_seq in the msk Geliang Tang
2021-09-14 15:40   ` Paolo Abeni
2021-09-14  9:19 ` [PATCH mptcp-next v3 3/8] mptcp: infinite mapping sending Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 4/8] mptcp: add the fallback check Geliang Tang
2021-09-14  9:19 ` Geliang Tang [this message]
2021-09-14  9:19 ` [PATCH mptcp-next v3 6/8] mptcp: add mib for infinite map sending Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 7/8] selftests: mptcp: add infinite map mibs check Geliang Tang
2021-09-14  9:19 ` [PATCH mptcp-next v3 8/8] DO-NOT-MERGE: mptcp: mp_fail test Geliang Tang

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=27849702bc924bbab7ca914387e18b6dadfe5622.1631610729.git.geliangtang@gmail.com \
    --to=geliangtang@gmail.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.