]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not request DHCP addresses configured on checking prefix delegation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Feb 2024 19:30:34 +0000 (04:30 +0900)
committerLuca Boccassi <bluca@debian.org>
Sat, 17 Feb 2024 11:48:25 +0000 (11:48 +0000)
This does not change anything for DHCPv4, as a DHCPv4 address is always
requested anyway. However for DHCPv6, the client may not request IA_NA
addresses by UseAddress=no, or even if it is requested, the server may
not provide any IA_NA addresses. Even in such cases, here the check is
for delegated prefixes, hence it is not necessary to check if DHCPv6
IA_NA addresses are configured.

Fixes a bug introduced by 195b83edf852f4e40e0d3a3b630cde97c84d77ba.

Fixes #31349.

src/network/networkd-link.c

index 566d251b15339307ff986ff4a393114fed9744ec..953910170240336485f807165880e56ff84bcf66 100644 (file)
@@ -567,7 +567,7 @@ void link_check_ready(Link *link) {
         if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) {
                 if (link_dhcp4_enabled(link) && link->network->dhcp_use_6rd &&
                     sd_dhcp_lease_has_6rd(link->dhcp_lease)) {
-                        if (!dhcp4_ready)
+                        if (!link->dhcp4_configured)
                                 return (void) log_link_debug(link, "%s(): DHCPv4 6rd prefix is assigned, but DHCPv4 protocol is not finished yet.", __func__);
                         if (!dhcp_pd_ready)
                                 return (void) log_link_debug(link, "%s(): DHCPv4 is finished, but prefix acquired by DHCPv4-6rd is not assigned yet.", __func__);
@@ -575,7 +575,7 @@ void link_check_ready(Link *link) {
 
                 if (link_dhcp6_enabled(link) && link->network->dhcp6_use_pd_prefix &&
                     sd_dhcp6_lease_has_pd_prefix(link->dhcp6_lease)) {
-                        if (!dhcp6_ready)
+                        if (!link->dhcp6_configured)
                                 return (void) log_link_debug(link, "%s(): DHCPv6 IA_PD prefix is assigned, but DHCPv6 protocol is not finished yet.", __func__);
                         if (!dhcp_pd_ready)
                                 return (void) log_link_debug(link, "%s(): DHCPv6 is finished, but prefix acquired by DHCPv6 IA_PD is not assigned yet.", __func__);