]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not try to save link state file twice on boot
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 24 Oct 2023 09:13:08 +0000 (18:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 24 Oct 2023 09:39:47 +0000 (18:39 +0900)
On enumeration, (that is, before manager_start() is called), enumerated
links may already have the dirty flag. In that case, saving the state
file in manager_start() should clear the flag.

src/network/networkd-manager.c

index f597eb358b70e21e36de61c66144930b47ef5a90..e02d0992b410d6c0e0262fd4ce93b9d531a6f903 100644 (file)
@@ -692,7 +692,7 @@ int manager_start(Manager *m) {
                 log_warning_errno(r, "Failed to update state file %s, ignoring: %m", m->state_file);
 
         HASHMAP_FOREACH(link, m->links_by_index) {
-                r = link_save(link);
+                r = link_save_and_clean(link);
                 if (r < 0)
                         log_link_warning_errno(link, r, "Failed to update link state file %s, ignoring: %m", link->state_file);
         }