Skip to content

Commit

Permalink
mptcp: infinite mapping receiving
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and David S. Miller committed Apr 23, 2022
1 parent 1e39e5a commit f8d4bca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -1220,7 +1222,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
*/
Expand Down

0 comments on commit f8d4bca

Please sign in to comment.