Skip to content

Commit

Permalink
mptcp: Wake up MPTCP worker when DATA_FIN found on a TCP FIN packet
Browse files Browse the repository at this point in the history
jira LE-1907
Rebuild_History Non-Buildable kernel-4.18.0-294.el8
commit-author Mat Martineau <[email protected]>
commit ef59b19

When receiving a DATA_FIN MPTCP option on a TCP FIN packet, the DATA_FIN
information would be stored but the MPTCP worker did not get
scheduled. In turn, the MPTCP socket state would remain in
TCP_ESTABLISHED and no blocked operations would be awakened.

TCP FIN packets are seen by the MPTCP socket when moving skbs out of the
subflow receive queues, so schedule the MPTCP worker when a skb with
DATA_FIN but no data payload is moved from a subflow queue. Other cases
(DATA_FIN on a bare TCP ACK or on a packet with data payload) are
already handled.

Closes: multipath-tcp/mptcp_net-next#84
Fixes: 43b54c6 ("mptcp: Use full MPTCP-level disconnect state machine")
	Acked-by: Paolo Abeni <[email protected]>
	Signed-off-by: Mat Martineau <[email protected]>
	Signed-off-by: Matthieu Baerts <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>
(cherry picked from commit ef59b19)
	Signed-off-by: Jonathan Maple <[email protected]>
  • Loading branch information
PlaidCat committed Sep 11, 2024
1 parent 8cb9873 commit 04b4a23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,

if (mpext->data_fin == 1) {
if (data_len == 1) {
mptcp_update_rcv_data_fin(msk, mpext->data_seq);
bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq);
pr_debug("DATA_FIN with no payload seq=%llu", mpext->data_seq);
if (subflow->map_valid) {
/* A DATA_FIN might arrive in a DSS
Expand All @@ -707,6 +707,9 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
skb_ext_del(skb, SKB_EXT_MPTCP);
return MAPPING_OK;
} else {
if (updated && schedule_work(&msk->work))
sock_hold((struct sock *)msk);

return MAPPING_DATA_FIN;
}
} else {
Expand Down

0 comments on commit 04b4a23

Please sign in to comment.