1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

network: require DHCP protocol to be finished when an address of delegated prefix is assigned

This commit is contained in:
Yu Watanabe 2023-05-30 15:29:05 +09:00
parent 5f950e5621
commit 195b83edf8

View File

@ -462,6 +462,25 @@ void link_check_ready(Link *link) {
(!link->network->ipv6_accept_ra_use_autonomous_prefix ||
link_check_addresses_ready(link, NETWORK_CONFIG_SOURCE_NDISC));
/* If the uplink for PD is self, then request the corresponding DHCP protocol is also ready. */
if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) {
if (link_dhcp4_enabled(link) && link->network->dhcp_use_6rd &&
link->dhcp_lease && dhcp4_lease_has_pd_prefix(link->dhcp_lease)) {
if (!dhcp4_ready)
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__);
}
if (link_dhcp6_enabled(link) && link->network->dhcp6_use_pd_prefix &&
link->dhcp6_lease && dhcp6_lease_has_pd_prefix(link->dhcp6_lease)) {
if (!dhcp6_ready)
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__);
}
}
/* At least one dynamic addressing protocol is finished. */
if (!ipv4ll_ready && !dhcp4_ready && !dhcp6_ready && !dhcp_pd_ready && !ndisc_ready)
return (void) log_link_debug(link, "%s(): dynamic addressing protocols are enabled but none of them finished yet.", __func__);