]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: delay to configure address until it is removed on reconfigure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jul 2023 06:43:53 +0000 (15:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jul 2023 07:06:17 +0000 (16:06 +0900)
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.

src/network/networkd-address.c
src/network/networkd-util.h

index 5c87a6c9c767710ff26ba35dded619e03b06fddb..57a9ceb229878e19e8c14be38de6a6c2afb27155 100644 (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;
 
index 9c360f55264f2db1ce6d56b6e392a959cbe1a4d0..8ffe4b5b5be976a9a0e619c62bb3a32cf4b825d2 100644 (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 |   \