Skip to content

Commit 9c29e36

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: fix DSS map generation on fin retransmission
The RFC 8684 mandates that no-data DATA FIN packets should carry a DSS with 0 sequence number and data len equal to 1. Currently, on FIN retransmission we re-use the existing mapping; if the previous fin transmission was part of a partially acked data packet, we could end-up writing in the egress packet a non-compliant DSS. The above will be detected by a "Bad mapping" warning on the receiver side. This change addresses the issue explicitly checking for 0 len packet when adding the DATA_FIN option. Fixes: 6d0060f ("mptcp: Write MPTCP DSS headers to outgoing data packets") Reported-by: [email protected] Tested-by: Christoph Paasch <[email protected]> Reviewed-by: Christoph Paasch <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5eff069 commit 9c29e36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/mptcp/options.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,
449449
}
450450

451451
static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
452-
struct mptcp_ext *ext)
452+
struct sk_buff *skb, struct mptcp_ext *ext)
453453
{
454-
if (!ext->use_map) {
454+
if (!ext->use_map || !skb->len) {
455455
/* RFC6824 requires a DSS mapping with specific values
456456
* if DATA_FIN is set but no data payload is mapped
457457
*/
@@ -503,7 +503,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
503503
opts->ext_copy = *mpext;
504504

505505
if (skb && tcp_fin && subflow->data_fin_tx_enable)
506-
mptcp_write_data_fin(subflow, &opts->ext_copy);
506+
mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
507507
ret = true;
508508
}
509509

0 commit comments

Comments
 (0)