Re: [PATCH mptcp-next RFC 2/3] mptcp: reject MP_JOIN earlier

Paolo Abeni <[email protected]>
Newsgroups dev.linux.lists.mptcp
Message-ID <[email protected]>
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.

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).

/P
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.