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.
This commit is contained in:
Yu Watanabe 2019-03-04 12:20:51 +09:00
parent 299ad32d48
commit 23041689ca
1 changed files with 8 additions and 0 deletions

View 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);
}
}