diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-link.c | 12 | ||||
-rw-r--r-- | src/network/networkd.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 14cc8715ce..4044f0b5a5 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -63,6 +63,8 @@ int link_new(Manager *manager, struct udev_device *device, Link **ret) { if (r < 0) return r; + link->udev_device = udev_device_ref(device); + *ret = link; link = NULL; @@ -85,6 +87,8 @@ void link_free(Link *link) { free(link->ifname); free(link->state_file); + udev_device_unref(link->udev_device); + free(link); } @@ -1283,10 +1287,18 @@ int link_add(Manager *m, struct udev_device *device, Link **ret) { return r; if (link->network->ipv4ll) { + uint8_t seed[8]; r = sd_ipv4ll_new(&link->ipv4ll); if (r < 0) return r; + r = net_get_unique_predictable_data(link->udev_device, seed); + if (r >= 0) { + r = sd_ipv4ll_set_address_seed(link->ipv4ll, seed); + if (r < 0) + return r; + } + r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0); if (r < 0) return r; diff --git a/src/network/networkd.h b/src/network/networkd.h index 311350c1e2..239ef1cd38 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -198,6 +198,7 @@ struct Link { char *ifname; char *state_file; struct ether_addr mac; + struct udev_device *udev_device; unsigned flags; |