From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 994C643164 for ; Fri, 29 Aug 2025 20:33:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499631; cv=none; b=hB/2k8YllqNozrIPv5sKNui+SuxorODAu0uwJdObzPea/wMUnVRl3vyWAyHdk785vLegMTgWCh/JUGQi27BXPWKU1CPGCDMNE17s3hMi0mHIJmXteuXjIuiRmAR2DEcshLTp/9HugmqSLAh3k7U1MtOAJMGRiF5vKONEffPFiQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499631; c=relaxed/simple; bh=/ocqZ1pnYr49wkaa5Q/pxuf32eXYH9m6DoyE7plu6mM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VnOLeCOCahTBgZ1++qgQpcbdEZstFVWlFObGaaeHGR+fYEElNN/KKCWQLVI828fvzcVkEWUUEzn5djWNanW4GpHTl5o8Wc9OtcOnCcqIXaWznzTxSOCRckrIesvgMvTFTS7e98uxrxJzyt13j4Uhncy/fiTP6GWTusclaH21MUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jzA2ZlMk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jzA2ZlMk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91FA4C4CEF6; Fri, 29 Aug 2025 20:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499631; bh=/ocqZ1pnYr49wkaa5Q/pxuf32eXYH9m6DoyE7plu6mM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jzA2ZlMkbHMxf9nkzL14YCVyiW82fxOc0XG+tMbgKGPdgskIT0PeHB8QOdexUvO2Z XTaSY3KAtcQGJcsUz3LBVCQScmO6WjpAFm4+RCnWBw3ToE4AbVqjdwZSO/CtjNjnc9 hU7/Fk529sudxKG6jZqb6A0aQz6OjhP8KqKLbFnC+DXkDjB0PzxHwM5ku/FRgoG7ws l83x1tbDJnU+MN8KgKMfeWkhtJ5yidiegYbSERwRSZqY0Mulht940QA+9OzXDeAQXy FUHOlrbnwxGs00etB4t+IXOi/wEMUpmCXKEPpGpkWxTJbKu2A8Pb0fv5YiG4366KS1 ILFSByBJCijmA== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:33 +0200 Subject: [PATCH mptcp-net 1/7] mptcp: set remote_deny_join_id0 on SYN recv Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-1-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1206; i=matttbe@kernel.org; h=from:subject:message-id; bh=/ocqZ1pnYr49wkaa5Q/pxuf32eXYH9m6DoyE7plu6mM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28S2XV3JqvByjf6VyfbO7p5ph7fODvVsmLtngf+HQn MvhVxiWd5SyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAExkIz/Dfw/lu/93RV5Qbde2 twl4toVlxw15ucNtqo2RbS/PrWv58oaR4fn9u07zLqZd+XpmqlqqimKK2zWOHs0KJqPVDg3GOfy 1DAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When a SYN containing the 'C' flag (deny join id0) was received, this piece of information was not propagated to the path-manager. Even if this flag is mainly set on the server side, a client can also tell the server it cannot try to establish new subflows to the client's initial IP address and port. The server's PM should then record such info when received, and before sending events about the new connection. Fixes: df377be38725 ("mptcp: add deny_join_id0 in mptcp_options_received") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/subflow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index c8a7e4b59db1150610f99d6e599a9d4cf7e137bc..e8325890a32238bd1fd558b9551= 37a2fa32f66c2 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -883,6 +883,10 @@ static struct sock *subflow_syn_recv_sock(const struct= sock *sk, =20 ctx->subflow_id =3D 1; owner =3D mptcp_sk(ctx->conn); + + if (mp_opt.deny_join_id0) + WRITE_ONCE(owner->pm.remote_deny_join_id0, true); + mptcp_pm_new_connection(owner, child, 1); =20 /* with OoO packets we can reach here without ingress --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E96343164 for ; Fri, 29 Aug 2025 20:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499632; cv=none; b=Ib+hS7YMG5zYnx2c3L765vucpRYOnhibVa7h6Q1snNibJ64qTEJecqNTdB1x09HhY2v2e5vhv2rc/wO3n4GEih8DhkWdi7/qpjwFKbsOYwmaiQw/v7ZSFKb8SLKCRHgmKPOEcrLLL3fn257aupzG6MmVBSj2r7AfMg25/oieb0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499632; c=relaxed/simple; bh=6xpiOJVfnSp0HZUm4b+y3GtQCdIp6zA+cayiJvK8JDY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=raKxe/G9xM87vkdC/gsim9Gm26UfLF9wRbMcPmhljroB80bsi2XlkENU5tG+km4LfUW2vXAS2KVqOjiSIEe6Ekodx0TZsfS70LViGqEHsTHQ6up8cZQL0/gbiOJnJd+i8mkvYAfSyrXWQawcvhJSe/1XMN6Sb7KZtb/ZphKbvSI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iqyz29Xk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iqyz29Xk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F0EBC4CEF0; Fri, 29 Aug 2025 20:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499631; bh=6xpiOJVfnSp0HZUm4b+y3GtQCdIp6zA+cayiJvK8JDY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=iqyz29XkRvPWKn2F62yrVB9PpxAs7q4c7taU9sVrOLKGU7cqaWgTqY2gGZHIh+Esr CdAywT17zuaxCliyUTCdBPkEgXzpp3vEiKY6U3a2djYGU6yKvRtUQA8X/oUGmUSllX DclmsIz41GPmpREpzizON/zx4WflRPixra504DYepepAKwNNB7ioUwdL3PUaNTEhI1 Ky1iT+0/QTUqCnBKC79+MIONasoAXgI95JC7vxPYQQdHKc1sKWCK0Ad6F3bBTxjdN7 SrzxrA847DwD9UEf/CyxWNeWjwcjuCLO96BNKuiwS5wm/GkxkTApGPqYkH/LHEQxAd 09B9WgOFwPAcw== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:34 +0200 Subject: [PATCH mptcp-net 2/7] mptcp: pm: userspace: respect deny_join_id0 attr Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-2-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1440; i=matttbe@kernel.org; h=from:subject:message-id; bh=6xpiOJVfnSp0HZUm4b+y3GtQCdIp6zA+cayiJvK8JDY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a0wnT3xX/bBU/+E1FckGQTaePl6HcllTF327+tu3 ry/TI77O0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACbytJaR4YK8+92ctT6rIz0F z1p9LpBz7LwjWfTjdG+q+zO28OVxQgz/g1f5hGTm/hN+/Iq1583BYwpFlRvnT8+39ZLUd/zYfia bFQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 During the connection establishment, a peer can tell the other that it cannot establish new subflows to the initial IP address and port by setting the 'C' flag [1]. The RFC8684 is strict about that: (...) therefore the receiver MUST NOT try to open any additional subflows toward this address and port. It is then important not to let the userspace PM establishing such subflows, and return an error (ECONNREFUSED) if it tries to do so. Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establ= ishment") Link: https://datatracker.ietf.org/doc/html/rfc8684\#section-3.1-20.6 [1] Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_userspace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 1911fe1799fa38a53381247a830a9a0daf1c4492..9968dc9a8b45112114953f66848= ea22c971136d6 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -391,6 +391,12 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *sk= b, struct genl_info *info) if (err < 0) goto create_err; =20 + if (READ_ONCE(msk->pm.remote_deny_join_id0) && addr_r.id =3D=3D 0) { + GENL_SET_ERR_MSG(info, "deny join id0"); + err =3D -ECONNREFUSED; + goto create_err; + } + if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) { GENL_SET_ERR_MSG(info, "families mismatch"); err =3D -EINVAL; --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3573643164 for ; Fri, 29 Aug 2025 20:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499633; cv=none; b=VVy6lwzOJ8eLSRyNwOxWxFfqaCEF778uxonWATaC+6quITfNIUjs2JhZMlaULu1H4TleHslMn0aNtiY9YKWyJgrRP9gyAmuC6wT8Mc8y2v0+k9tc1gRJM2PO/GQ5LZhdrrCQbv61dFB0MaX/XY60Ok8plV5nW+gk061877a2vnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499633; c=relaxed/simple; bh=NmqdA92ojYh5FV5PJu2c0LhMQQi6VjAx5mCmW8JwJcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Pz54/iINWF22OJftg1jVykNquncMY48eY3FvhXrazjwrRIGwfVGEgxl4OABTeJdL08ELua4fYt9TQinb0qiaWRnWgM8q8s9xkqN4l5H1lOOO5JiJylogc/rQJFpjC9HBkCJB8HoBHM7MRjBMiu1IG7e0tgMc1M2u7+50ZhbCZ+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eD8v5GdC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eD8v5GdC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BEC0C4CEF6; Fri, 29 Aug 2025 20:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499632; bh=NmqdA92ojYh5FV5PJu2c0LhMQQi6VjAx5mCmW8JwJcI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eD8v5GdCCtg+Z8IDfrS8G9oNUq0MrusIDnNnXOF9RKoahBdaVmRDJpJuUw/elGq1V LrPclcsN+wGdK4xonHkQTuyhWFlreXr/6eD+AN21OVvLK9ri2r9p6Hhs05v/oXlEcP wDWcpWw9H+z2SwTwOOstEgTnDmkG6qEBDmtTxefAxeBUJqdy3FGC/9/l31rMC8vc8g KQJAd2qh/w2xctN6lc0ezay+9KXx4zAkj6huLM/2Usya9zuEadHZJu4+3RXmxnTcwY dmyw+Vm09rRXyE2kUEaSfL0EbzCwm7sYWuPtUrmNL70fI4es1PtGg/dXbLo7N2H0V5 Pi5HGhva0wEIw== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:35 +0200 Subject: [PATCH mptcp-net 3/7] mptcp: tfo: record 'deny join id0' info Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-3-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1293; i=matttbe@kernel.org; h=from:subject:message-id; bh=NmqdA92ojYh5FV5PJu2c0LhMQQi6VjAx5mCmW8JwJcI=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a3cKtppcefp/aALMl98+3pnHtAVYDmtWdQimhkrl yPh+NK5o5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCKlXxgZeng+hDDWfHzx7V6O SILqMbGaZBmZyplMq38FXs5bMkPVjJGha8+699qiq//kWukzHu++2ZT6a2Fw5IR7FRwhhT/7pvp zAgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When TFO is used, the check to see if the 'C' flag (deny join id0) was set was bypassed. This flag can be set when TFO is used, so the check should also be done when TFO is used. Fixes: dfc8d0603033 ("mptcp: implement delayed seq generation for passive f= astopen") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/options.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index d47b8a9bc2df2f14645b1b3d3e10fea1b38567b1..cf531f2d815cdfbc772b837def6= e7d558e64d558 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -985,14 +985,14 @@ static bool check_fully_established(struct mptcp_sock= *msk, struct sock *ssk, return false; } =20 - if (mp_opt->deny_join_id0) - WRITE_ONCE(msk->pm.remote_deny_join_id0, true); - if (unlikely(!READ_ONCE(msk->pm.server_side))) /* DO-NOT-MERGE: use WARN i/o pr_warn: only for MPTCP export */ WARN_ONCE(1, "bogus mpc option on established client sk"); =20 set_fully_established: + if (mp_opt->deny_join_id0) + WRITE_ONCE(msk->pm.remote_deny_join_id0, true); + mptcp_data_lock((struct sock *)msk); __mptcp_subflow_fully_established(msk, subflow, mp_opt); mptcp_data_unlock((struct sock *)msk); --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4D0D43164 for ; Fri, 29 Aug 2025 20:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499633; cv=none; b=GSSvnnyeTAwdgwrsXCpfcs9Sqihq28qflvGu1GOHan1/l0O/d1eMxzbU905tC6AjKFLxDgUvfWY0/HZJg7jqHCw4W8isJBLi4tuJCanQ9OniyYXol54glUx1Da8teY6CtPbCwULBr7BO8JiUmEU8jDFX7pj4ja+F6NyZB65R74s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499633; c=relaxed/simple; bh=phkh1oyOpFzwyQWIWC84ieXCahTRZMlNzgz8Cr1mz9E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n36jFytExAOlGXgiN1H//+pDfljDssICdSJZ74VoqJqa3sHgmab1cVzlz/jmB6st9SrExoGOA5VmLv99hsPOsCqy4MEfLv1XfYBWPpw2pl1MFuKODrqShFbYMwSMfI/tZwUBaUYZVXcyyCHtxohPnXc41s8tFQwC1moD7/EF6u0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NAHJDDVg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NAHJDDVg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28BDBC4CEF0; Fri, 29 Aug 2025 20:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499633; bh=phkh1oyOpFzwyQWIWC84ieXCahTRZMlNzgz8Cr1mz9E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NAHJDDVgGdgvzZq7m39u0+CGHV3dQuPYSTTOcYcL+WqzNXzDMilnLWkFrxWP2E7Vm V2fDaBFaGJmJrowiqxgMmBQE3CD2kjuL0KDg15GxeCzgK5cgfcVJANInfocAfZolfh knVER7uu4Gc184uHeYzE4mWcH8iTVSa5anpPlzQSPkWYvivDCNw7WLLpaq0QZc74od AexS3zNJuqT6VVq70YMstEUK1XocgBn0KgR5FsmdkunhrihrHrYavP0P/S2te4EidZ qW6K74jx9z5nHl6zA2xex9We7UCFWGLGRJv32AMB8kjOQszljgHmGaOcOQwFwodZx4 SsTjHhnQ+o/HQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:36 +0200 Subject: [PATCH mptcp-net 4/7] netlink: specs: mptcp: fix if-idx attribute type Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-4-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1008; i=matttbe@kernel.org; h=from:subject:message-id; bh=phkh1oyOpFzwyQWIWC84ieXCahTRZMlNzgz8Cr1mz9E=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a36uO24leX0jWGv1mq9cWU1mdJ4u3TvrWyv1ddWS mxal/VJuKOUhUGMi0FWTJFFui0yf+bzKt4SLz8LmDmsTCBDGLg4BWAi0kaMDCufmR3av/kWf6JH g9t/2VPNz1kmvmg8Py9ix75pu+ISPWYz/FNpPvWua1Nm6N6jnEeSPl/yKnjOdqTke004R0ug6k7 GY1wA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This attribute is used as a signed number in the code in pm_netlink.c: nla_put_s32(skb, MPTCP_ATTR_IF_IDX, ssk->sk_bound_dev_if)) The specs should then reflect that. Note that other 'if-idx' attributes from the same .yaml file use a signed number as well. Fixes: bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- Documentation/netlink/specs/mptcp_pm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netl= ink/specs/mptcp_pm.yaml index 02f1ddcfbf1cfd81a398dd03c52bb9f281c1aa08..d15335684ec3d6256505f2b3887= ce5818eb57462 100644 --- a/Documentation/netlink/specs/mptcp_pm.yaml +++ b/Documentation/netlink/specs/mptcp_pm.yaml @@ -256,7 +256,7 @@ attribute-sets: type: u32 - name: if-idx - type: u32 + type: s32 - name: reset-reason type: u32 --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9429E43164 for ; Fri, 29 Aug 2025 20:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499634; cv=none; b=Mcf3fyfzlyIpCM9IIYdK48Nbn6W+K9LW2IQpHeke/5IvLIO4IJ8JjcT7JZ1Atz63Ui9oeGyYTlq0QTNq88mS/9iciHudqx7T7AiruAKj57RdafIQWO72XUP8NuT/Naw6wv7Q2EiXhAOxdDTauo7EnTa/AJLApk8fjT8kzJij8WE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499634; c=relaxed/simple; bh=NQSPI+JMUx4nEmpPGbd1iV8SHl5xpcAQusfRy1b79+g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PrpUNTPPcHjO5/xVWHmJvT+gURUh33BUZhE5a9xNy5WMDdxLekZdOhq93a9HF/kgf8GamgX8e6xLMmjdpbkANliWAiOX5jydP7ImLtho/vAaTJdFb6Je4BN53rhzu2Hc6CyWoUTNg/B4ji1v7ZXuHAZ1j3+HYC0Z5pr/ozQWOqI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RI4FCjFV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RI4FCjFV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05919C4CEF7; Fri, 29 Aug 2025 20:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499634; bh=NQSPI+JMUx4nEmpPGbd1iV8SHl5xpcAQusfRy1b79+g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RI4FCjFVciiVHgS3KmzvBTw6dNBUQ5uBQy/mhqA41ZX0hxa2i2B0oECHtE9LL4q9e s5wV9KgOIiJoCOPycuHKPAcrnpbBgV24DSdXrinfCZpoMQpeTOU5rlj53zUCRJOJNs BIXF7oJr+Wl4gMrEs46aRjlSNsmssfeMmVdSvCFXSfDwLsasGc2xqhBhFiXzSF2U8e KZoMuxdP9DsTlZQbne9IDJeoh9AdH9jncdm21HKeLqdjH2sJabVXGzO+1hxeq+LK6l Cl7IsvGTgjqhGLWg6fL2eamDYf7VizI2+xZUVR8ao2XCTbHdSec+ZkMRvWLiaLxXZc x2Z/Tn9ovKBMQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:37 +0200 Subject: [PATCH mptcp-net 5/7] doc: mptcp: net.mptcp.pm_type is deprecated Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-5-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1777; i=matttbe@kernel.org; h=from:subject:message-id; bh=NQSPI+JMUx4nEmpPGbd1iV8SHl5xpcAQusfRy1b79+g=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a2OY+hL2VLnlq+T3u8pn+O7Ji1lS8HF6u9JRwWC9 61/mZHYUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMBFxCYZ/Zm4aUk99z8zJkA18 d2HizJVZi+4tMqhQ8b544+/83T+Y+BgZzv3/bdleYLCj62lS2e/bbmEbnJ+0LdH697R5ivozzsf mnAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The net.mptcp.pm_type sysctl knob has been deprecated in v6.15, net.mptcp.path_manager should be used instead. Adapt the section about path managers to suggest using the new sysctl knob instead of the deprecated one. Fixes: 595c26d122d1 ("mptcp: sysctl: set path manager by name") Signed-off-by: Matthieu Baerts (NGI0) --- Documentation/networking/mptcp.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/networking/mptcp.rst b/Documentation/networking/= mptcp.rst index 17f2bab611644727e19c3969fa08fa974c702d92..2e31038d6462051387be9bd8808= a23230db08315 100644 --- a/Documentation/networking/mptcp.rst +++ b/Documentation/networking/mptcp.rst @@ -60,10 +60,10 @@ address announcements. Typically, it is the client side= that initiates subflows, and the server side that announces additional addresses via the ``ADD_ADDR= `` and ``REMOVE_ADDR`` options. =20 -Path managers are controlled by the ``net.mptcp.pm_type`` sysctl knob -- s= ee -mptcp-sysctl.rst. There are two types: the in-kernel one (type ``0``) wher= e the -same rules are applied for all the connections (see: ``ip mptcp``) ; and t= he -userspace one (type ``1``), controlled by a userspace daemon (i.e. `mptcpd +Path managers are controlled by the ``net.mptcp.path_manager`` sysctl knob= -- +see mptcp-sysctl.rst. There are two types: the in-kernel one (``kernel``) = where +the same rules are applied for all the connections (see: ``ip mptcp``) ; a= nd the +userspace one (``userspace``), controlled by a userspace daemon (i.e. `mpt= cpd `_) where different rules can be applied for ea= ch connection. The path managers can be controlled via a Netlink API; see netlink_spec/mptcp_pm.rst. --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7005643164 for ; Fri, 29 Aug 2025 20:33:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499635; cv=none; b=KocnLQ1qfkfIhO3NTxgiBFnljgskMU2rnnjlfcO+xra0mZRBuQLMuhYD/TyD6ldNj0p9pR0yEnozbEegMDPsvYv9NVTwmmBjhmVTJ3Ud+JxUr9rPUsPUAqRWMB3sS54UVWPczNN1YlfbDjQeacdbrdoAAQVqwI/bJtChnbB7AeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499635; c=relaxed/simple; bh=g379lyf7TLQ/isY1EW3k/F/29wnqhKJr1yE63TgWuhs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MXrkfDtI7SZACwW4rb/K4wlozWu6qIrQYckf5znKUbZKsUcI0joTn2EyBt6F/7nF7W5Ti+wqRBUx+SZayaq/1htfZ9deRdtJfmQ+0HipBEjc8vs4fULm98cbzJIPDhwfz1L4lsPC9mJV4H/V07KBF59sHZ7fJRyQXKb3mmZ/DJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cLdcrnnR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cLdcrnnR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D62E6C4CEF0; Fri, 29 Aug 2025 20:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499635; bh=g379lyf7TLQ/isY1EW3k/F/29wnqhKJr1yE63TgWuhs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cLdcrnnRK7U1lC+h9IwALipYHLzriNr3nEo/X/XkezBal/wfQ0CI2Q0O7sNclWoxM 1LNYwn6TBPx2PDZwuV9b5InpX0rT6RkyFRGlTPhRyFnZzq4NF5v7BNbuy7a2oyUxgB XNaJNTQ207KmtvIga1ZRqeSsECMNuP9qUYylILiylmRuuAPRqlTmJOet67sA6aoFpz fVtIE188I8eDtKCGQUE7OkQUHLw4D/LlBYuWpymGhSxZ3lCuR1SQhrfU7uLkB57hM0 CWEG4TJmD6X4CG4QUFCAigzvuocy0t87m/yP5CvMiiFnPgBoUy5NUrXmv8RxSi60i7 wfK8Dq1Mq9slg== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:38 +0200 Subject: [PATCH mptcp-net 6/7] selftests: mptcp: shellcheck: support v0.11.0 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-6-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4986; i=matttbe@kernel.org; h=from:subject:message-id; bh=g379lyf7TLQ/isY1EW3k/F/29wnqhKJr1yE63TgWuhs=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a1pelyxvyKL7bTMN/vizMqoQBHONN0PjpNDbmdvP 5Cp1pbaUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMJHzZowMS609n+Rntdw0FI/a MUN0Z0Tepr7Hb2xvHohWOMwQlz5FgOF/2qGfOzPPFzXl1HneEdXYvGLbztS63vyNq7b9yLr8t3I VPwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This v0.11.0 version introduces SC2329: Warn when (non-escaping) functions are never invoked. Except that, similar to SC2317, ShellCheck is currently unable to figure out functions that are invoked via trap, or indirectly, when calling functions via variables. It is then needed to disable this new SC2329. Signed-off-by: Matthieu Baerts (NGI0) --- Note: I guess this patch is a good candidate for 'net'. --- tools/testing/selftests/net/mptcp/diag.sh | 2 +- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +- tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 2 +- tools/testing/selftests/net/mptcp/pm_netlink.sh | 5 +++-- tools/testing/selftests/net/mptcp/simult_flows.sh | 2 +- tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/self= tests/net/mptcp/diag.sh index 7a3cb4c09e450f0ae570015c4724ec268c6dc19f..d847ff1737c30c0eae1cefeb5a8= 3bd3223897707 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -28,7 +28,7 @@ flush_pids() } =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index 5e3c56253274a1f938d2ed9986c4290fcea8b96b..c2ab9f7f0d2133559bb18ce884b= 613d21d1ec5f0 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -134,7 +134,7 @@ ns4=3D"" TEST_GROUP=3D"" =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { rm -f "$cin_disconnect" diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index a97b568104bc284f050b2f0e09fe3fdd3341c5cb..f2133e247d8cbc17abd3c356326= 1068a65b56ad8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -8,7 +8,7 @@ =20 # ShellCheck incorrectly believes that most of the code here is unreachable # because it's invoked by variable name, see how the "tests" array is used -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 =20 . "$(dirname "${0}")/mptcp_lib.sh" =20 diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_sockopt.sh index 418a903c3a4d396bd733bf8b6f68b1447d4d1de3..f01989be6e9b3daeecc5a8f41b3= 7c9a284efef61 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -95,7 +95,7 @@ init() } =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { mptcp_lib_ns_exit "${ns1}" "${ns2}" "${ns_sbox}" diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testin= g/selftests/net/mptcp/pm_netlink.sh index ac7ec6f9402376a34602ef1ca6c4822e8dde0ded..ec6a8758819194f2c53791d76ae= 68e088f188813 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -32,7 +32,7 @@ ns1=3D"" err=3D$(mktemp) =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { rm -f "${err}" @@ -70,8 +70,9 @@ format_endpoints() { mptcp_lib_pm_nl_format_endpoints "${@}" } =20 +# This function is invoked indirectly +#shellcheck disable=3DSC2317,SC2329 get_endpoint() { - # shellcheck disable=3DSC2317 # invoked indirectly mptcp_lib_pm_nl_get_endpoint "${ns1}" "${@}" } =20 diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/test= ing/selftests/net/mptcp/simult_flows.sh index 2329c2f8519b7c336e9f90a705dfa7588207a543..1903e8e84a315175e2ffd620dd7= b4e94dbf25dfb 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -35,7 +35,7 @@ usage() { } =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { rm -f "$cout" "$sout" diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/test= ing/selftests/net/mptcp/userspace_pm.sh index 333064b0b5ac03ae003417d2070f3c08f94743ed..970c329735ff14f87f0048ba003= 0dc7edaaa86bc 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -94,7 +94,7 @@ test_fail() } =20 # This function is used in the cleanup trap -#shellcheck disable=3DSC2317 +#shellcheck disable=3DSC2317,SC2329 cleanup() { print_title "Cleanup" --=20 2.50.1 From nobody Wed Sep 17 16:14:26 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5FC643164 for ; Fri, 29 Aug 2025 20:33:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499636; cv=none; b=f98Sx0iPh4n/lJ41LFQbX7zi44DGw5KsNRgXqHNMY94U49YVJMEQ/qJuKRbi482YG/uPh3dGpME4XjM+N8BElYiS5Kfma+BKtdaOjRydjWUiTcTFgwSGygq7cxlYysphsy3RWTu7pvfhDrY7rG7z6p7AtrmxALU6KNQptVqeUBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756499636; c=relaxed/simple; bh=Tq08SLZzDAhqrGXS5HqJEDTMk09WlVZl7E9I2C+nylg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kzURBhcySAi/kubV7MDFthzeJ0hoFsCPe0Gf8OHBei6Vnk0Ez5FUrSGTp0Ma3hU4FCeTYAwktPvOwMuknFZT/3Ou+fTg8+kc29l99eWK1jh7aU1+u+0+QUNF3Ls9z4sMR2ONTbp2AOhpKhBDTbqnC1zt4EFaBcviM0MtSH9fNT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ba522DNr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ba522DNr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B399FC4CEF6; Fri, 29 Aug 2025 20:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756499636; bh=Tq08SLZzDAhqrGXS5HqJEDTMk09WlVZl7E9I2C+nylg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ba522DNrbRKc9uVANA+cW7gAunOqVaSq77oKbMuB4mr5QmdmBxxKhl+clRLucEgOc 4oxJ6bQv2RRYfgZq513++AGvRRp13RcjkJAvuIaWbBFe/gqo9o45kl53hL+wt9Bhoy UM9M93lLS9uTkEbgduEHHp3AvxdqkqnDXQPl959oUE5/BfJ7B6UZM/bOq0Lz3kuCBm /loZjCa7mPfmRH5ZKYg4owZulSXf8xU43gz+Khj0icpJ+X2XUtEqEehU9H8jv2M6XN m3vszdrbRmjSrY7LIW0mcTiBYAGARhQrkgmdQIdhTOI+vrsR35ssiVqIagTuCyryoX N2411qGyhXikg== From: "Matthieu Baerts (NGI0)" Date: Fri, 29 Aug 2025 22:33:39 +0200 Subject: [PATCH RFC mptcp-net 7/7] mptcp: pm: nl: announce deny-join-id0 attribute Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250829-mptcp-pm-user-c-flag-v1-7-78b25dda7708@kernel.org> References: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> In-Reply-To: <20250829-mptcp-pm-user-c-flag-v1-0-78b25dda7708@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5615; i=matttbe@kernel.org; h=from:subject:message-id; bh=Tq08SLZzDAhqrGXS5HqJEDTMk09WlVZl7E9I2C+nylg=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI28a2N+iJfHMlSFLRooeYTfebfHZ8+OK262ZastubB1 u9zcvp+d5SyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAExE6DDDP/UGs9bO+raTpeuX tGczqfx4xPE2YMH8k+wLv91xYzHvvM3wv1A8QzezjYM95xjj7oNmyUw1DF9ydhs7Zl44z73IIlq bFQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 During the connection establishment, a peer can tell the other that it cannot establish new subflows to the initial IP address and port by setting the 'C' flag [1]. Doing so makes sense when the sender is behind a strict NAT, operating behind a legacy Layer 4 load balancer, or using anycast IP address for example. When this 'C' flag is set, the path-managers must then not try to establish new subflow to the other peer's initial IP address and port. The in-kernel PM has access to this info, but the userspace PM didn't. When a new connection is created and established, the Netlink events will now contain a new deny-join-id0 attribute. When set to 1, it means no other subflow to the initial IP address and port -- which is part of the event -- can be established. Link: https://datatracker.ietf.org/doc/html/rfc8684#section-3.1-20.6 [1] Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/532 Signed-off-by: Matthieu Baerts (NGI0) --- This patch is marked as an RFC, just so we can agree on the attribute type: should we use a new dedicated attribute, or start using flags? It even looks like we have defined a "flags" attribute, but it is currently not used. Using "flags" would allow us to save some bytes, and in this case, 'server-side' should have used "flags" too. The problem with the flags is that the userspace cannot tell if a new flag is unset because the kernel doesn't support it, or because it doesn't need to be set. But is it really an issue? If the kernel doesn't support it, the userspace will probably not know what to do anyway. So fine to use flags? Or not needed, because it is unlikely to add new attributes later on? If yes, I suggest: - switching 'flags' to u32 instead of u16 because it doesn't change anything, and it is currently not used - deprecating the 'server-side' attribute, and adding it in the flags (but keeping it for the moment, maybe we can remove it in a few versions?) - adding deny-join-id0 as a flag: MPTCP_PM_EVENT_FLAG_DENY_JOIN_ID0 If no, we can use what is proposed here. In any cases, I would like to add a test. I initially added one in userspace_pm.sh, but due to "mptcp: pm: userspace: respect deny_join_id0 attr", it is no longer possible to set allow_join_initial_addr_port sysctl knob to 0 there, as the value is no longer ignored by the userspace PM. Probably best to add a test in mptcp_join.sh. --- Documentation/netlink/specs/mptcp_pm.yaml | 7 +++++-- include/uapi/linux/mptcp_pm.h | 5 +++-- net/mptcp/pm_netlink.c | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netl= ink/specs/mptcp_pm.yaml index d15335684ec3d6256505f2b3887ce5818eb57462..0b53d8b5b4524b6026009cfa451= 0e7a6e141acf1 100644 --- a/Documentation/netlink/specs/mptcp_pm.yaml +++ b/Documentation/netlink/specs/mptcp_pm.yaml @@ -28,13 +28,13 @@ definitions: traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, spo= rt, - dport, server-side. + dport, server-side, deny-join-id0. - name: established doc: >- A MPTCP connection is established (can start new subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, spo= rt, - dport, server-side. + dport, server-side, deny-join-id0. - name: closed doc: >- @@ -266,6 +266,9 @@ attribute-sets: - name: server-side type: u8 + - + name: deny-join-id0 + type: u8 =20 operations: list: diff --git a/include/uapi/linux/mptcp_pm.h b/include/uapi/linux/mptcp_pm.h index 6ac84b2f636ca22935c191c645449fb62b673899..6c751c488e51d6ab71160718904= 1d5e2ea222e4e 100644 --- a/include/uapi/linux/mptcp_pm.h +++ b/include/uapi/linux/mptcp_pm.h @@ -16,10 +16,10 @@ * good time to allocate memory and send ADD_ADDR if needed. Depending o= n the * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABL= ISHED * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, - * sport, dport, server-side. + * sport, dport, server-side, deny-join-id0. * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start = new * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr= 6, - * sport, dport, server-side. + * sport, dport, server-side, deny-join-id0. * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token. * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer. * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport]. @@ -126,6 +126,7 @@ enum mptcp_event_attr { MPTCP_ATTR_RESET_REASON, MPTCP_ATTR_RESET_FLAGS, MPTCP_ATTR_SERVER_SIDE, + MPTCP_ATTR_DENY_JOIN_ID0, =20 __MPTCP_ATTR_MAX }; diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 50aaf259959aeaf36e7ab954c6f7957eaf2bc390..93455b63ef80395ff19f40d84cd= 28438a3578b98 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -415,6 +415,10 @@ static int mptcp_event_created(struct sk_buff *skb, if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side= ))) return -EMSGSIZE; =20 + if (nla_put_u8(skb, MPTCP_ATTR_DENY_JOIN_ID0, + READ_ONCE(msk->pm.remote_deny_join_id0))) + return -EMSGSIZE; + return mptcp_event_add_subflow(skb, ssk); } =20 --=20 2.50.1