]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: drop IPv6LL addresses manually configured in .network file
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 11 Dec 2021 17:26:22 +0000 (02:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Dec 2021 13:43:18 +0000 (22:43 +0900)
src/network/networkd-address.c

index 7cd4d27c074df9fac75046126b9f1f9792a9516f..c4a666a908c173cf921abf1ce2e0bd024609527a 100644 (file)
@@ -895,8 +895,11 @@ int link_drop_addresses(Link *link) {
                 if (!address_exists(address))
                         continue;
 
-                /* We consider IPv6LL addresses to be managed by the kernel, or dropped in link_drop_ipv6ll_addresses() */
-                if (address->family == AF_INET6 && in6_addr_is_link_local(&address->in_addr.in6))
+                /* Do not drop IPv6LL addresses assigned by the kernel here. They will be dropped in
+                 * link_drop_ipv6ll_addresses() if IPv6LL addressing is disabled. */
+                if (address->source == NETWORK_CONFIG_SOURCE_FOREIGN &&
+                    address->family == AF_INET6 &&
+                    in6_addr_is_link_local(&address->in_addr.in6))
                         continue;
 
                 k = address_remove(address);