From: Yu Watanabe Date: Sat, 4 Dec 2021 20:14:22 +0000 (+0900) Subject: network: dhcp6pd: skip to assign prefixes to a downstream link if it is not ready X-Git-Tag: v250-rc1~54^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3cd535132ddc5b6e4db5f74954e7d275d121282;p=thirdparty%2Fsystemd.git network: dhcp6pd: skip to assign prefixes to a downstream link if it is not ready --- diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c index dbe7bcdc9a0..44858c66032 100644 --- a/src/network/networkd-dhcp-prefix-delegation.c +++ b/src/network/networkd-dhcp-prefix-delegation.c @@ -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(), ×tamp_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(), ×tamp_usec); if (r < 0) return r;