]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: roll back ipv6ll_address on link_ipv6ll_gained() failure 42745/head
authordongshengyuan <545258830@qq.com>
Thu, 25 Jun 2026 08:19:14 +0000 (16:19 +0800)
committerdongshengyuan <545258830@qq.com>
Thu, 25 Jun 2026 08:19:14 +0000 (16:19 +0800)
If link_ipv6ll_gained() fails after ipv6ll_address is set, the address
remains non-null and the null-guard in address_update() never triggers
again, permanently suppressing SLAAC, DHCPv6 and RA on that link.

Clear ipv6ll_address on the failure path so the guard can fire when
the address is re-announced.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
src/network/networkd-address.c

index 11337126e58915f6c962aff5c3daa8aa87acd006..582069cf3974549feca4122c66d77792ddf54528 100644 (file)
@@ -811,8 +811,10 @@ static int address_update(Address *address) {
                 link->ipv6ll_address = address->in_addr.in6;
 
                 r = link_ipv6ll_gained(link);
-                if (r < 0)
+                if (r < 0) {
+                        link->ipv6ll_address = (const struct in6_addr) {};
                         return r;
+                }
         }
 
         if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))