network: do not request DHCP addresses configured on checking prefix delegation

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 195b83edf8.

Fixes #31349.
This commit is contained in:
Yu Watanabe
2024-02-17 11:48:25 +00:00
committed by Luca Boccassi
parent 43a752669e
commit b4054aff24
+2 -2
View 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__);