]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp: refuse to configure DHCP IAID if the interface is under renaming 11881/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Mar 2019 03:20:51 +0000 (12:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Mar 2019 03:48:26 +0000 (12:48 +0900)
systemd-networkd itself does not start dhcp client, but the code
may be used in other projects. So, check that the interface is under
renaming or not.

src/libsystemd-network/dhcp-identifier.c

index 04bf64cce5f2f702423094f31e17021128c73732..0c1ff34e5de339b22de17c1381fa0fa5ccee5293 100644 (file)
@@ -12,6 +12,7 @@
 #include "siphash24.h"
 #include "sparse-endian.h"
 #include "stdio-util.h"
+#include "udev-util.h"
 #include "virt.h"
 
 #define SYSTEMD_PEN    43793
@@ -182,6 +183,13 @@ int dhcp_identifier_set_iaid(
                                 /* not yet ready */
                                 return -EBUSY;
 
+                        r = device_is_renaming(device);
+                        if (r < 0)
+                                return r;
+                        if (r > 0)
+                                /* device is under renaming */
+                                return -EBUSY;
+
                         name = net_get_name(device);
                 }
         }