diff options
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index f1a2695e83..ce1f956eaf 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -588,9 +588,13 @@ static int link_acquire_conf(Link *link) { assert(link->manager->event); if (!link->dhcp) { - link->dhcp = sd_dhcp_client_new(link->manager->event); - if (!link->dhcp) - return -ENOMEM; + r = sd_dhcp_client_new(&link->dhcp); + if (r < 0) + return r; + + r = sd_dhcp_client_attach_event(link->dhcp, NULL, 0); + if (r < 0) + return r; r = sd_dhcp_client_set_index(link->dhcp, link->ifindex); if (r < 0) |