Skip to content

Commit da9b2fc

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: reset fallback status gracefully at disconnect() time
mptcp_disconnect() clears the fallback bit unconditionally, without touching the associated flags. The bit clear is safe, as no fallback operation can race with that -- all subflow are already in TCP_CLOSE status thanks to the previous FASTCLOSE -- but we need to consistently reset all the fallback related status. Also acquire the relevant lock, to avoid fouling static analyzers. Fixes: b29fcfb ("mptcp: full disconnect implementation") Cc: [email protected] Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent def5b7b commit da9b2fc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

net/mptcp/protocol.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,7 +3142,16 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31423142
* subflow
31433143
*/
31443144
mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE);
3145+
3146+
/* The first subflow is already in TCP_CLOSE status, the following
3147+
* can't overlap with a fallback anymore
3148+
*/
3149+
spin_lock_bh(&msk->fallback_lock);
3150+
msk->allow_subflows = true;
3151+
msk->allow_infinite_fallback = true;
31453152
WRITE_ONCE(msk->flags, 0);
3153+
spin_unlock_bh(&msk->fallback_lock);
3154+
31463155
msk->cb_flags = 0;
31473156
msk->recovery = false;
31483157
WRITE_ONCE(msk->can_ack, false);

0 commit comments

Comments
 (0)