diff mbox series

[1/2] mptcp: reset last_snd on subflow close

Message ID 20210211234245.31961-1-fw@strlen.de
State Accepted, archived
Commit 114aa23af8986d300b4270c4b28a7a669cbcd487
Delegated to: Matthieu Baerts
Headers show
Series [1/2] mptcp: reset last_snd on subflow close | expand

Commit Message

Florian Westphal Feb. 11, 2021, 11:42 p.m. UTC
Send logic caches last active subflow in the msk, so it needs to be
cleared when the cached subflow is closed.

Fixes: d5f49190def61c ("mptcp: allow picking different xmit subflows")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/155
Reported-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/mptcp/protocol.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Matthieu Baerts Feb. 12, 2021, 5:15 p.m. UTC | #1
Hi Florian,

On 12/02/2021 00:42, Florian Westphal wrote:
> Send logic caches last active subflow in the msk, so it needs to be
> cleared when the cached subflow is closed.

Thank you for the patch!

> Fixes: d5f49190def61c ("mptcp: allow picking different xmit subflows")
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/155
> Reported-by: Christoph Paasch <cpaasch@apple.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>   net/mptcp/protocol.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index d49e0efbdd50..fdd6b3cb0bf5 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2145,6 +2145,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;

I see that this patch is for -net but it looks like "msk" is not defined 
in this function. Same in net-next in fact.

I also see that you declare "msk" in patch 2/2. I can move the 
declaration in patch 1/2 when applying it. (Not sure when we want to 
send it to netdev, I guess "soon", no?)

Cheers,
Matt
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index d49e0efbdd50..fdd6b3cb0bf5 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2145,6 +2145,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,