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: https://github.com/multipath-tcp/mptcp_net-next/issues/155
Reported-by: Christoph Paasch <cpaasch@apple.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Mar 4, 2021
1 parent bfc2560 commit e0be493
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 @@ -2126,6 +2126,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 @@ -2154,6 +2156,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 e0be493

Please sign in to comment.