Skip to content

Commit

Permalink
network: require DHCP protocol to be finished when an address of dele…
Browse files Browse the repository at this point in the history
…gated prefix is assigned
  • Loading branch information
yuwata committed May 30, 2023
1 parent 5f950e5 commit 195b83e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/network/networkd-link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit 195b83e

Please sign in to comment.