Skip to content

Commit ef59b19

Browse files
mjmartineaudavem330
authored andcommitted
mptcp: Wake up MPTCP worker when DATA_FIN found on a TCP FIN packet
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 <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 805c6d3 commit ef59b19

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/mptcp/subflow.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
731731

732732
if (mpext->data_fin == 1) {
733733
if (data_len == 1) {
734-
mptcp_update_rcv_data_fin(msk, mpext->data_seq);
734+
bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq);
735735
pr_debug("DATA_FIN with no payload seq=%llu", mpext->data_seq);
736736
if (subflow->map_valid) {
737737
/* A DATA_FIN might arrive in a DSS
@@ -742,6 +742,9 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
742742
skb_ext_del(skb, SKB_EXT_MPTCP);
743743
return MAPPING_OK;
744744
} else {
745+
if (updated && schedule_work(&msk->work))
746+
sock_hold((struct sock *)msk);
747+
745748
return MAPPING_DATA_FIN;
746749
}
747750
} else {

0 commit comments

Comments
 (0)