+ 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;
+
+ r = sd_ipv4ll_set_index(link->ipv4ll, link->ifindex);
+ if (r < 0)
+ return r;
+
+ r = sd_ipv4ll_set_callback(link->ipv4ll, ipv4ll_handler, link);
+ if (r < 0)
+ return r;
+ }
+
+ if (link->network->dhcp) {
+ r = sd_dhcp_client_new(&link->dhcp_client);
+ if (r < 0)
+ return r;
+
+ r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0);
+ if (r < 0)
+ return r;
+
+ r = sd_dhcp_client_set_index(link->dhcp_client, link->ifindex);
+ if (r < 0)
+ return r;
+
+ r = sd_dhcp_client_set_callback(link->dhcp_client, dhcp_handler, link);
+ if (r < 0)
+ return r;
+
+ if (link->network->dhcp_mtu) {
+ r = sd_dhcp_client_set_request_option(link->dhcp_client, 26);
+ if (r < 0)
+ return r;
+ }
+ }
+