]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-manager.c
network: do not configure interfaces under renaming
[thirdparty/systemd.git] / src / network / networkd-manager.c
index 079cd3e1d156184f2f8ab9ae782d82853504c37e..c87f907957a9d688e1e96144c331243c07f993b4 100644 (file)
@@ -26,6 +26,7 @@
 #include "strv.h"
 #include "sysctl-util.h"
 #include "tmpfile-util.h"
+#include "udev-util.h"
 #include "virt.h"
 
 /* use 8 MB for receive socket kernel queue. */
@@ -194,7 +195,7 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi
                 return 0;
         }
 
-        if (!STR_IN_SET(action, "add", "change")) {
+        if (!STR_IN_SET(action, "add", "change", "move")) {
                 log_device_debug(device, "Ignoring udev %s event for device.", action);
                 return 0;
         }
@@ -205,6 +206,16 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi
                 return 0;
         }
 
+        r = device_is_renaming(device);
+        if (r < 0) {
+                log_device_error_errno(device, r, "Failed to determine the device is renamed or not, ignoring '%s' uevent: %m", action);
+                return 0;
+        }
+        if (r > 0) {
+                log_device_debug(device, "Interface is under renaming, wait for the interface to be renamed: %m");
+                return 0;
+        }
+
         r = link_get(m, ifindex, &link);
         if (r < 0) {
                 if (r != -ENODEV)