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:
parent
299ad32d48
commit
23041689ca
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue