Skip to content

Commit f8d4bca

Browse files
geliangtangdavem330
authored andcommitted
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>
1 parent 1e39e5a commit f8d4bca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/mptcp/subflow.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,9 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
10061006

10071007
data_len = mpext->data_len;
10081008
if (data_len == 0) {
1009+
pr_debug("infinite mapping received");
10091010
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
1011+
subflow->map_data_len = 0;
10101012
return MAPPING_INVALID;
10111013
}
10121014

@@ -1220,7 +1222,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
12201222
return true;
12211223
}
12221224

1223-
if (subflow->mp_join || subflow->fully_established) {
1225+
if ((subflow->mp_join || subflow->fully_established) && subflow->map_data_len) {
12241226
/* fatal protocol error, close the socket.
12251227
* subflow_error_report() will introduce the appropriate barriers
12261228
*/

0 commit comments

Comments
 (0)