chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
importd: create a loopback btrfs file system for /var/lib/machines, if necessary
[elogind.git]
/
src
/
libsystemd-network
/
dhcp-identifier.c
diff --git
a/src/libsystemd-network/dhcp-identifier.c
b/src/libsystemd-network/dhcp-identifier.c
index 5386dca9e2d4957087b84e354bb0299f71d9e800..f7a1492363435d1e62b81f117dcc9295cf36fe70 100644
(file)
--- a/
src/libsystemd-network/dhcp-identifier.c
+++ b/
src/libsystemd-network/dhcp-identifier.c
@@
-19,7
+19,6
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/ethernet.h>
#include "sd-id128.h"
#include "libudev.h"
#include "sd-id128.h"
#include "libudev.h"
@@
-28,7
+27,6
@@
#include "virt.h"
#include "sparse-endian.h"
#include "siphash24.h"
#include "virt.h"
#include "sparse-endian.h"
#include "siphash24.h"
-#include "util.h"
#include "dhcp6-protocol.h"
#include "dhcp-identifier.h"
#include "dhcp6-protocol.h"
#include "dhcp-identifier.h"
@@
-78,20
+76,19
@@
int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t
sprintf(ifindex_str, "n%d", ifindex);
device = udev_device_new_from_device_id(udev, ifindex_str);
sprintf(ifindex_str, "n%d", ifindex);
device = udev_device_new_from_device_id(udev, ifindex_str);
- if (!device)
- return -errno;
+ if (device) {
+ if (udev_device_get_is_initialized(device) <= 0)
+ /* not yet ready */
+ return -EBUSY;
- if (udev_device_get_is_initialized(device) <= 0)
- /* not yet ready */
- return -EBUSY;
-
- name = net_get_name(device);
+ name = net_get_name(device);
+ }
}
if (name)
siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes);
else
}
if (name)
siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes);
else
- /* fall back to
mac
address if no predictable name available */
+ /* fall back to
MAC
address if no predictable name available */
siphash24((uint8_t*)&id, mac, mac_len, HASH_KEY.bytes);
/* fold into 32 bits */
siphash24((uint8_t*)&id, mac, mac_len, HASH_KEY.bytes);
/* fold into 32 bits */