All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Matthieu Baerts <matttbe@kernel.org>,
	MPTCP Linux <mptcp@lists.linux.dev>
Cc: Chenguang Zhao <chenguang.zhao@linux.dev>, gang.yan@linux.dev
Subject: Re: [PATCH mptcp-next RFC 2/3] mptcp: reject MP_JOIN earlier
Date: Mon, 17 Aug 2026 15:03:46 +0200	[thread overview]
Message-ID: <1434f3ca-ead2-4723-9ef3-e91b99f89e31@redhat.com> (raw)
In-Reply-To: <f5ba94b7-449f-45d1-b98e-c997faefa4ee@kernel.org>

On 8/17/26 11:49 AM, Matthieu Baerts wrote:
> On 17/08/2026 09:27, Paolo Abeni wrote:
>> On 8/14/26 8:31 PM, Matthieu Baerts (NGI0) wrote:
>>> @@ -91,12 +92,22 @@ static struct mptcp_sock *subflow_token_join_request(struct request_sock *req)
>>>  	msk = mptcp_token_get_sock(sock_net(req_to_sk(req)), subflow_req->token);
>>>  	if (!msk) {
>>>  		SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINNOTOKEN);
>>> +		*reason = MPTCP_RST_EMPTCP;
>>> +		return NULL;
>>> +	}
>>> +
>>> +	/* Stop it early if the subflow cannot be accepted */
>>> +	if (!mptcp_can_accept_new_subflow(msk)) {
>>
>> Side note: the above is inherently racy, the consistency safeguard is
>> given by the fallback check at finish_join time.
> 
> Just to be sure: even if it is racy, is it OK to use it here but
> continuing having the safe check at finish_join time?
> 
> In other words, having such a comment is enough?
> 
>   /* Stop it early if the subflow cannot be accepted.
>    * This check is inherently racy, the consistency safeguard is
>    * given by the fallback check at finish_join time.
>    */

I think so.

>> Minor nit: I'm not sure this check belongs here or in
>> subflow_check_req(). The latter option would avoid the additional
>> argument and possibly produce a smaller diff (and smaller code).
> 
> After re-looking at this code yesterday, I agree with you. Also, I think
> subflow_token_join_request() should only return the msk, and not
> changing anything else from subflow_req.
Makes sense.

Somewhat related: to avoid subflow_check_req() growing too much, it
would possibly make sense move the final mp_join related bits in a
specific helper, and have just:

	} else if (opt_mp_join && listener->request_mptcp)
		return subflow_mpj_check_req(req, sk_listener);

/P


  reply	other threads:[~2026-08-17 13:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 18:31 [PATCH mptcp-next RFC 0/3] mptcp: reset fully_estab after fallback & reject MPJ earlier Matthieu Baerts (NGI0)
2026-08-14 18:31 ` [PATCH mptcp-next RFC 1/3] mptcp: no longer fully_established after a fallback Matthieu Baerts (NGI0)
2026-08-14 18:31 ` [PATCH mptcp-next RFC 2/3] mptcp: reject MP_JOIN earlier Matthieu Baerts (NGI0)
2026-08-14 18:40   ` sashiko-bot
2026-08-16 16:12   ` Matthieu Baerts
2026-08-16 16:13     ` Matthieu Baerts
2026-08-17  7:27   ` Paolo Abeni
2026-08-17  9:49     ` Matthieu Baerts
2026-08-17 13:03       ` Paolo Abeni [this message]
2026-08-14 18:31 ` [PATCH mptcp-next RFC 3/3] mptcp: pm: kernel: skip operating on closing connections Matthieu Baerts (NGI0)
2026-08-14 18:44   ` sashiko-bot
2026-08-17  7:39   ` Paolo Abeni
2026-08-17 11:07     ` Matthieu Baerts
2026-08-17 13:09       ` Paolo Abeni
2026-08-17 15:32         ` Matthieu Baerts

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=1434f3ca-ead2-4723-9ef3-e91b99f89e31@redhat.com \
    --to=pabeni@redhat.com \
    --cc=chenguang.zhao@linux.dev \
    --cc=gang.yan@linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.