Skip to content

Commit 0bac966

Browse files
mjmartineaudavem330
authored andcommitted
mptcp: Allow DATA_FIN in headers without TCP FIN
RFC 8684-compliant DATA_FIN needs to be sent and ack'd before subflows are closed with TCP FIN, so write DATA_FIN DSS headers whenever their transmission has been enabled by the MPTCP connection-level socket. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0003041 commit 0bac966

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

net/mptcp/options.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -482,17 +482,10 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
482482
struct mptcp_sock *msk;
483483
unsigned int ack_size;
484484
bool ret = false;
485-
u8 tcp_fin;
486485

487-
if (skb) {
488-
mpext = mptcp_get_ext(skb);
489-
tcp_fin = TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN;
490-
} else {
491-
mpext = NULL;
492-
tcp_fin = 0;
493-
}
486+
mpext = skb ? mptcp_get_ext(skb) : NULL;
494487

495-
if (!skb || (mpext && mpext->use_map) || tcp_fin) {
488+
if (!skb || (mpext && mpext->use_map) || subflow->data_fin_tx_enable) {
496489
unsigned int map_size;
497490

498491
map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
@@ -502,7 +495,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
502495
if (mpext)
503496
opts->ext_copy = *mpext;
504497

505-
if (skb && tcp_fin && subflow->data_fin_tx_enable)
498+
if (skb && subflow->data_fin_tx_enable)
506499
mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
507500
ret = true;
508501
}

0 commit comments

Comments
 (0)