Skip to content

Commit

Permalink
mptcp: reset last_snd on subflow close
Browse files Browse the repository at this point in the history
Send logic caches last active subflow in the msk, so it needs to be
cleared when the cached subflow is closed.

Fixes: d5f4919 ("mptcp: allow picking different xmit subflows")
Closes: #155
Reported-by: Christoph Paasch <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Reviewed-by: Matthieu Baerts <[email protected]>
Signed-off-by: Florian Westphal <[email protected]>
  • Loading branch information
Florian Westphal authored and jenkins-tessares committed Feb 18, 2021
1 parent 38b5133 commit c1e8864
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,8 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
struct mptcp_subflow_context *subflow)
{
struct mptcp_sock *msk = mptcp_sk(sk);

list_del(&subflow->node);

lock_sock_nested(ssk, SINGLE_DEPTH_NESTING);
Expand Down Expand Up @@ -2152,6 +2154,9 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
release_sock(ssk);

sock_put(ssk);

if (ssk == msk->last_snd)
msk->last_snd = NULL;
}

void mptcp_close_ssk(struct sock *sk, struct sock *ssk,
Expand Down

0 comments on commit c1e8864

Please sign in to comment.