From 12a4696229a7e6cc33a28fd0d6376a4547cdc93b Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Thu, 13 Nov 2025 19:19:22 +0100 Subject: [PATCH] mptcp: set the laminar flag by default By default, the MPTCP limits have 'add_addr_accepted' set to 0. It means that when the other peer announces an additional address it can be reached from, the receiver will not try to establish any new subflows to this address. If this limit is increased, and without the new 'laminar' flag, the MPTCP in-kernel path-manager will select the source address by looking at the routing tables to establish this new subflow. This is not ideal: very likely, the source address will be the one linked to the default route and a new subflow from the same interface as the initial one will be created instead of using another path. This is especially problematic when the other peer has set the 'C-flag' in the MPTCP connection request (MP_CAPABLE). This flag can be set to tell the other side that the peer will not accept extra subflows requests sent to its initial IP address and port: typically set by a server using an anycast address, behind a legacy Layer 4 load balancer. It sounds better to add the 'laminar' flag by default to pick the source address from well-defined MPTCP endpoints, rather than relying on routing rules which will likely not pick the most interesting solution. Note that older kernels will accept unsupported flags, and ignore them. So it is fine to have the new flag added by default even if it is not supported. Signed-off-by: Matthieu Baerts (NGI0) (cherry picked from commit 8caa781270e0427575381d9815dfb424ee5d0221) --- man/NetworkManager.conf.xml | 2 +- src/libnm-core-aux-intern/nm-libnm-core-utils.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 65cad02cf9..6c055e9d2e 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -895,7 +895,7 @@ ipv6.ip6-privacy=0 connection.mptcp-flags - If unspecified, the fallback is 0x22 ("enabled,subflow"). Note that if sysctl /proc/sys/net/mptcp/enabled is disabled, NetworkManager will still not configure endpoints. + If unspecified, the fallback is 0x122 ("enabled,subflow,laminar"). Note that if sysctl /proc/sys/net/mptcp/enabled is disabled, NetworkManager will still not configure endpoints. connection.dns-over-tls diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.h b/src/libnm-core-aux-intern/nm-libnm-core-utils.h index 432a21409f..0e75982ecc 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.h +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.h @@ -307,7 +307,8 @@ gpointer _nm_connection_new_setting(NMConnection *connection, GType gtype); | NM_MPTCP_FLAGS_SUBFLOW | NM_MPTCP_FLAGS_BACKUP | NM_MPTCP_FLAGS_FULLMESH \ | NM_MPTCP_FLAGS_LAMINAR)) -#define _NM_MPTCP_FLAGS_DEFAULT ((NMMptcpFlags) (NM_MPTCP_FLAGS_ENABLED | NM_MPTCP_FLAGS_SUBFLOW)) +#define _NM_MPTCP_FLAGS_DEFAULT \ + ((NMMptcpFlags) (NM_MPTCP_FLAGS_ENABLED | NM_MPTCP_FLAGS_SUBFLOW | NM_MPTCP_FLAGS_LAMINAR)) NMMptcpFlags nm_mptcp_flags_normalize(NMMptcpFlags flags);