Skip to content

Commit 333bb6c

Browse files
dcarattimatttbe
authored andcommitted
mptcp: use "middlebox interference" RST when no DSS
RFC8684 suggests use of "Middlebox interference (code 0x06)" in case of fully established subflow that carries data at TCP level with no DSS sub-option. This is generally the case when mpext is NULL or mpext->use_map is 0: use a dedicated value of 'mapping_status' and use it before closing the socket in subflow_check_data_avail(). Link: #518 Signed-off-by: Davide Caratti <[email protected]>
1 parent ace291d commit 333bb6c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/mptcp/subflow.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,8 @@ enum mapping_status {
971971
MAPPING_EMPTY,
972972
MAPPING_DATA_FIN,
973973
MAPPING_DUMMY,
974-
MAPPING_BAD_CSUM
974+
MAPPING_BAD_CSUM,
975+
MAPPING_NODSS
975976
};
976977

977978
static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn)
@@ -1128,8 +1129,9 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
11281129
return MAPPING_EMPTY;
11291130
}
11301131

1132+
/* If the required DSS has likely been dropped by a middlebox */
11311133
if (!subflow->map_valid)
1132-
return MAPPING_INVALID;
1134+
return MAPPING_NODSS;
11331135

11341136
goto validate_seq;
11351137
}
@@ -1343,7 +1345,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
13431345
status = get_mapping_status(ssk, msk);
13441346
trace_subflow_check_data_avail(status, skb_peek(&ssk->sk_receive_queue));
13451347
if (unlikely(status == MAPPING_INVALID || status == MAPPING_DUMMY ||
1346-
status == MAPPING_BAD_CSUM))
1348+
status == MAPPING_BAD_CSUM || status == MAPPING_NODSS))
13471349
goto fallback;
13481350

13491351
if (status != MAPPING_OK)
@@ -1396,7 +1398,9 @@ static bool subflow_check_data_avail(struct sock *ssk)
13961398
* subflow_error_report() will introduce the appropriate barriers
13971399
*/
13981400
subflow->reset_transient = 0;
1399-
subflow->reset_reason = MPTCP_RST_EMPTCP;
1401+
subflow->reset_reason = status == MAPPING_NODSS ?
1402+
MPTCP_RST_EMIDDLEBOX :
1403+
MPTCP_RST_EMPTCP;
14001404

14011405
reset:
14021406
WRITE_ONCE(ssk->sk_err, EBADMSG);

0 commit comments

Comments
 (0)