summaryrefslogtreecommitdiffstats
path: root/net/mptcp
diff options
context:
space:
mode:
authorGeliang Tang <geliang.tang@suse.com>2022-04-22 14:55:40 -0700
committerDavid S. Miller <davem@davemloft.net>2022-04-23 11:51:05 +0100
commitf8d4bcacff3b77f8778ae3ab97e0d175e861babf (patch)
treeb88e20c77f32d0cc83378498dd31c1997d9ed17f /net/mptcp
parent1e39e5a32ad7fdd82d6e071aa14ecd511eedc1f7 (diff)
downloadlinux-stable-f8d4bcacff3b77f8778ae3ab97e0d175e861babf.tar.gz
linux-stable-f8d4bcacff3b77f8778ae3ab97e0d175e861babf.tar.bz2
linux-stable-f8d4bcacff3b77f8778ae3ab97e0d175e861babf.zip
mptcp: infinite mapping receiving
This patch adds 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. Suggested-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/subflow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 31dcb550316f..30ffb00661bb 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1006,7 +1006,9 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
data_len = mpext->data_len;
if (data_len == 0) {
+ pr_debug("infinite mapping received");
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
+ subflow->map_data_len = 0;
return MAPPING_INVALID;
}
@@ -1220,7 +1222,7 @@ fallback:
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
*/