summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/dhcp-identifier.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-03-04 04:20:51 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-03-05 04:48:26 +0100
commit23041689ca511dd72dda13dab0c0699f1377bf70 (patch)
treee0380ca20fed0d2f79f858e62ee1e938a81ffa3c /src/libsystemd-network/dhcp-identifier.c
parentnetwork: do not configure interfaces under renaming (diff)
downloadsystemd-23041689ca511dd72dda13dab0c0699f1377bf70.tar.xz
systemd-23041689ca511dd72dda13dab0c0699f1377bf70.zip
dhcp: refuse to configure DHCP IAID if the interface is under renaming
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.
Diffstat (limited to 'src/libsystemd-network/dhcp-identifier.c')
-rw-r--r--src/libsystemd-network/dhcp-identifier.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c
index 04bf64cce5..0c1ff34e5d 100644
--- a/src/libsystemd-network/dhcp-identifier.c
+++ b/src/libsystemd-network/dhcp-identifier.c
@@ -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);
}
}