From: Yu Watanabe Date: Mon, 3 Jul 2023 06:43:53 +0000 (+0900) Subject: network: delay to configure address until it is removed on reconfigure X-Git-Tag: v254-rc1~49^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e8477edd3a988357ad5f5fa6610904d44ec402c;p=thirdparty%2Fsystemd.git network: delay to configure address until it is removed on reconfigure When we request an address that already exists and is under removing, we need to wait for the address being removed. Otherwise, configuration of a route whose preferred source is the address will fail. Fixes #28009. Replaces #28088. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 5c87a6c9c76..57a9ceb2298 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1158,6 +1158,9 @@ static bool address_is_ready_to_configure(Link *link, const Address *address) { if (!link_is_ready_to_configure(link, false)) return false; + if (address_is_removing(address)) + return false; + if (!ipv4acd_bound(address)) return false; diff --git a/src/network/networkd-util.h b/src/network/networkd-util.h index 9c360f55264..8ffe4b5b5be 100644 --- a/src/network/networkd-util.h +++ b/src/network/networkd-util.h @@ -125,6 +125,10 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret); NETWORK_CONFIG_STATE_REMOVING, \ NETWORK_CONFIG_STATE_REMOVING); \ } \ + static inline bool name##_is_removing(const type *t) { \ + assert(t); \ + return FLAGS_SET(t->state, NETWORK_CONFIG_STATE_REMOVING); \ + } \ static inline void name##_enter_removed(type *t) { \ name##_update_state(t, \ NETWORK_CONFIG_STATE_CONFIGURED | \