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.
This commit is contained in:
Yu Watanabe
2023-07-03 15:43:53 +09:00
parent b088c3d3fc
commit 6e8477edd3
2 changed files with 7 additions and 0 deletions

View File

@@ -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;

View File

@@ -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 | \