]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mptcp: pm: in kernel: only use fullmesh endp if any
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Sat, 1 Nov 2025 17:56:52 +0000 (18:56 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Nov 2025 01:15:06 +0000 (17:15 -0800)
Our documentation is saying that the in-kernel PM is only using fullmesh
endpoints to establish subflows to announced addresses when at least one
endpoint has a fullmesh flag. But this was not totally correct: only
fullmesh endpoints were used if at least one endpoint *from the same
address family as the received ADD_ADDR* has the fullmesh flag.

This is confusing, and it seems clearer not to have differences
depending on the address family.

So, now, when at least one MPTCP endpoint has a fullmesh flag, the local
addresses are picked from all fullmesh endpoints, which might be 0 if
there are no endpoints for the correct address family.

One selftest needs to be adapted for this behaviour change.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251101-net-next-mptcp-fm-endp-nb-bind-v1-2-b4166772d6bb@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_kernel.c
tools/testing/selftests/net/mptcp/mptcp_join.sh

index e2918c68ff023becfde3ee132403060b30ffd219..e50721c670d0027d7d665deafcb3bffe4d644080 100644 (file)
@@ -609,15 +609,11 @@ fill_local_addresses_vec(struct mptcp_sock *msk, struct mptcp_addr_info *remote,
                         struct mptcp_pm_local *locals)
 {
        bool c_flag_case = remote->id && mptcp_pm_add_addr_c_flag_case(msk);
-       int i;
 
        /* If there is at least one MPTCP endpoint with a fullmesh flag */
-       if (mptcp_pm_get_endp_fullmesh_max(msk)) {
-               i = fill_local_addresses_vec_fullmesh(msk, remote, locals,
-                                                     c_flag_case);
-               if (i)
-                       return i;
-       }
+       if (mptcp_pm_get_endp_fullmesh_max(msk))
+               return fill_local_addresses_vec_fullmesh(msk, remote, locals,
+                                                        c_flag_case);
 
        /* If there is at least one MPTCP endpoint with a laminar flag */
        if (mptcp_pm_get_endp_laminar_max(msk))
index 78a1aa4ecff2bc86e231e33267a46e1af739c2a6..e7a498dd5a468b7a5320ba083ab1e572d55ec79a 100755 (executable)
@@ -2952,7 +2952,11 @@ mixed_tests()
                pm_nl_add_endpoint $ns1 10.0.1.1 flags signal
                speed=slow \
                        run_tests $ns1 $ns2 dead:beef:2::1
-               chk_join_nr 1 1 1
+               if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_fullmesh_max$"; then
+                       chk_join_nr 0 0 0
+               else
+                       chk_join_nr 1 1 1
+               fi
        fi
 
        # fullmesh still tries to create all the possibly subflows with