public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	MPTCP Upstream <mptcp@lists.linux.dev>
Cc: Marco Angaroni <marco.angaroni@italtel.com>
Subject: Re: [PATCH mptcp-next 01/11] mptcp: avoid dup SUB_CLOSED events after disconnect
Date: Sun, 04 Jan 2026 11:15:21 +0800	[thread overview]
Message-ID: <c05e6947d8c058026516dc07554292ce21486526.camel@kernel.org> (raw)
In-Reply-To: <20251226-mptcp-issue-603-v1-1-bb30e331b839@kernel.org>

Hi Matt,

On Fri, 2025-12-26 at 07:40 +0100, Matthieu Baerts (NGI0) wrote:
> In case of subflow disconnect(), which can also happen with the first
> subflow in case of errors like timeout or reset,
> mptcp_subflow_ctx_reset
> will reset most fields from the mptcp_subflow_context structure,
> including close_event_done. Then, when another subflow is closed, yet
> another SUB_CLOSED event for the disconnected initial subflow is
> sent.
> Because of the previous reset, there are no source address and
> destination port.
> 
> A solution is then to also check the subflow's local id: it shouldn't
> be
> negative anyway.
> 
> Another solution would be not to reset subflow->close_event_done at
> disconnect time, but when reused. But then, probably the whole reset
> could be done when being reused. Let's not change this logic, similar
> to TCP with tcp_disconnect().
> 
> Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events")
> Reported-by: Marco Angaroni <marco.angaroni@italtel.com>
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/603
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
>  net/mptcp/protocol.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 900f26e21acd..1d68648b5194 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2622,8 +2622,8 @@ void mptcp_close_ssk(struct sock *sk, struct
> sock *ssk,
>  	struct mptcp_sock *msk = mptcp_sk(sk);
>  	struct sk_buff *skb;
>  
> -	/* The first subflow can already be closed and still in the
> list */
> -	if (subflow->close_event_done)
> +	/* The 1st subflow can already be closed/disco and still in
> the

I suggest that we avoid abbreviating it as "disco" here and instead
write out "disconnected" in full. If that makes this line of comment
too long, it can be split into two lines.

Besides this, this patch looks good to me.

    Reviewed-by: Geliang Tang <geliang@kernel.org>

Thanks,
-Geliang

> list */
> +	if (subflow->close_event_done || READ_ONCE(subflow-
> >local_id) < 0)
>  		return;
>  
>  	subflow->close_event_done = true;

  reply	other threads:[~2026-01-04  3:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26  6:40 [PATCH mptcp-next 00/11] mptcp: avoid dup events + error + misc Matthieu Baerts (NGI0)
2025-12-26  6:40 ` [PATCH mptcp-next 01/11] mptcp: avoid dup SUB_CLOSED events after disconnect Matthieu Baerts (NGI0)
2026-01-04  3:15   ` Geliang Tang [this message]
2025-12-26  6:40 ` [PATCH mptcp-next 02/11] selftests: mptcp: check no dup close events after error Matthieu Baerts (NGI0)
2026-01-04  3:17   ` Geliang Tang
2025-12-26  6:40 ` [PATCH mptcp-next 03/11] mptcp: only reset subflow errors when propagated Matthieu Baerts (NGI0)
2026-01-04  3:30   ` Geliang Tang
2026-01-04  4:00     ` Geliang Tang
2025-12-26  6:40 ` [PATCH mptcp-next 04/11] selftests: mptcp: check subflow errors in close events Matthieu Baerts (NGI0)
2025-12-26  6:40 ` [PATCH mptcp-next 05/11] selftests: mptcp: join: wait for estab event instead of MPJ Matthieu Baerts (NGI0)
2025-12-28  2:41   ` Geliang Tang
2025-12-26  6:40 ` [PATCH mptcp-next 06/11] selftests: mptcp: join: fix wait_mpj helper Matthieu Baerts (NGI0)
2025-12-26  6:40 ` [PATCH mptcp-next 07/11] selftests: mptcp: join: userspace: wait for new events Matthieu Baerts (NGI0)
2025-12-28  2:48   ` Geliang Tang
2026-01-26 18:59     ` Matthieu Baerts
2025-12-26  6:40 ` [PATCH mptcp-next 08/11] selftests: mptcp: join chk_stale_nr: avoid dup stats Matthieu Baerts (NGI0)
2025-12-28  2:25   ` Geliang Tang
2025-12-28  4:43     ` Geliang Tang
2025-12-26  6:40 ` [PATCH mptcp-next 09/11] selftests: mptcp: join: avoid declaring i if not used Matthieu Baerts (NGI0)
2025-12-28  2:51   ` Geliang Tang
2025-12-26  6:40 ` [PATCH mptcp-next 10/11] selftests: mptcp: connect: fix maybe-uninitialize warn Matthieu Baerts (NGI0)
2025-12-28  2:54   ` Geliang Tang
2026-01-26 19:02     ` Matthieu Baerts
2025-12-26  6:40 ` [PATCH mptcp-next 11/11] selftests: mptcp: connect cleanup TFO setup Matthieu Baerts (NGI0)
2025-12-28  2:59   ` Geliang Tang
2025-12-26  7:51 ` [PATCH mptcp-next 00/11] mptcp: avoid dup events + error + misc MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c05e6947d8c058026516dc07554292ce21486526.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=marco.angaroni@italtel.com \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox