network: dhcp6pd: skip to assign prefixes to a downstream link if it is not ready

This commit is contained in:
Yu Watanabe
2021-12-06 21:35:53 +09:00
parent 5014e66019
commit c3cd535132
@@ -621,7 +621,7 @@ static int dhcp6_pd_prepare(Link *link) {
link_mark_addresses(link, NETWORK_CONFIG_SOURCE_DHCP6PD, NULL);
link_mark_routes(link, NETWORK_CONFIG_SOURCE_DHCP6PD, NULL);
return 0;
return 1;
}
static int dhcp6_pd_finalize(Link *link) {
@@ -781,11 +781,11 @@ static int dhcp6_pd_assign_prefixes(Link *link, Link *uplink) {
/* This is similar to dhcp6_pd_prefix_acquired(), but called when a downstream interface
* appears later or reconfiguring the interface. */
r = sd_dhcp6_lease_get_timestamp(uplink->dhcp6_lease, clock_boottime_or_monotonic(), &timestamp_usec);
if (r < 0)
r = dhcp6_pd_prepare(link);
if (r <= 0)
return r;
r = dhcp6_pd_prepare(link);
r = sd_dhcp6_lease_get_timestamp(uplink->dhcp6_lease, clock_boottime_or_monotonic(), &timestamp_usec);
if (r < 0)
return r;