From 6bf859af792b14fb9afab7675de1fd6d40e23f78 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 17 Feb 2025 11:17:14 +0100 Subject: [PATCH] l3cfg: wait for the address before configuring an MPTCP endpoint Skip the configuration of the MPTCP endpoint when the address is in the l3cd but is not yet configured in the platform. This typically happens when IPv4 DAD is enabled and the address is being probed. If we configure the endpoint without the address set, the kernel will try to use the endpoint immediately but it will fail. Then, the endpoint will not be used ever again after the address is added. --- src/core/nm-l3cfg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index abeef3df7..cb77928bd 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -5051,6 +5051,8 @@ _l3_commit_mptcp_af(NML3Cfg *self, self->priv.p->combined_l3cd_commited, addr_family, (const NMPlatformIPAddress **) &addr) { + const NMPObject *obj; + /* We want to evaluate the with-{loopback,link_local}-{4,6} flags based on the actual * ifa_scope that the address will have once we configure it. * "addr" is an address we want to configure, we expect that it will @@ -5077,6 +5079,16 @@ _l3_commit_mptcp_af(NML3Cfg *self, break; } + obj = nm_platform_ip_address_get(self->priv.platform, + addr_family, + self->priv.ifindex, + addr); + if (!obj) { + /* The address is not yet configured in platform, typically due to + * IPv4 DAD; skip it for now otherwise the kernel will try to use + * the endpoint, it will fail, and it will never try it again. */ + goto skip_addr; + } a.addr = nm_ip_addr_init(addr_family, addr->ax.address_ptr); /* We track the address with different priorities, that depends