summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-01-22 21:18:30 +0100
committerTom Gundersen <teg@jklm.no>2015-01-22 21:29:42 +0100
commit40862866417265ac8c20422cb44f14a8f141ce0d (patch)
tree7fea9e771d663b402361b2c60166bf9b9ca77c41 /src/libsystemd-network
parentb16492f86f13abd4a9447afd0910139af9656906 (diff)
dhcp-identifier: create IAID even if no udev device can be found
This is useful for testing.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/dhcp-identifier.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c
index 5386dca9e2..e4b0ce6b2e 100644
--- a/src/libsystemd-network/dhcp-identifier.c
+++ b/src/libsystemd-network/dhcp-identifier.c
@@ -78,14 +78,13 @@ 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);
- 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)