Skip to content

Commit e149927

Browse files
matttbeintel-lab-lkp
authored andcommitted
mptcp: reset when MPTCP opts are dropped after join
Before this patch, if the checksum was not used, the subflow was only reset if map_data_len was != 0. If there were no MPTCP options or an invalid mapping, map_data_len was not set to the data len, and then the subflow was not reset as it should have been, leaving the MPTCP connection in a wrong fallback mode. This map_data_len condition has been introduced to handle the reception of the infinite mapping. So instead, a new dedicated mapping error is now returned (infinite), and this special case is properly handled: the exception is only applied to this case now, and not other ones by mistake. While at it, no need to set map_data_len to 0 as it will be set to skb->len just after, at the end of subflow_check_data_avail(). Fixes: f8d4bca ("mptcp: infinite mapping receiving") Reported-by: Chester A. Unal <[email protected]> Closes: multipath-tcp/mptcp_net-next#544 Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 3a7786d commit e149927

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/mptcp/subflow.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ enum mapping_status {
969969
MAPPING_DATA_FIN,
970970
MAPPING_DUMMY,
971971
MAPPING_BAD_CSUM,
972+
MAPPING_INFINITE,
972973
MAPPING_NODSS
973974
};
974975

@@ -1139,8 +1140,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
11391140
if (data_len == 0) {
11401141
pr_debug("infinite mapping received\n");
11411142
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
1142-
subflow->map_data_len = 0;
1143-
return MAPPING_INVALID;
1143+
return MAPPING_INFINITE;
11441144
}
11451145

11461146
if (mpext->data_fin == 1) {
@@ -1357,7 +1357,8 @@ static bool subflow_check_data_avail(struct sock *ssk)
13571357
status = get_mapping_status(ssk, msk);
13581358
trace_subflow_check_data_avail(status, skb_peek(&ssk->sk_receive_queue));
13591359
if (unlikely(status == MAPPING_INVALID || status == MAPPING_DUMMY ||
1360-
status == MAPPING_BAD_CSUM || status == MAPPING_NODSS))
1360+
status == MAPPING_BAD_CSUM || status == MAPPING_INFINITE ||
1361+
status == MAPPING_NODSS))
13611362
goto fallback;
13621363

13631364
if (status != MAPPING_OK)
@@ -1405,7 +1406,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
14051406
return true;
14061407
}
14071408

1408-
if (!subflow_can_fallback(subflow) && subflow->map_data_len) {
1409+
if (!subflow_can_fallback(subflow) && status != MAPPING_INFINITE) {
14091410
/* fatal protocol error, close the socket.
14101411
* subflow_error_report() will introduce the appropriate barriers
14111412
*/

0 commit comments

Comments
 (0)