network: attach sd-event in link_load() when creating link dhcp_client or ipv4ll
Commit 08c588d18b
moved attachment of the
sd-event into creation of the dhcp_client or ipv4ll in dhcp4_configure()
or ipv4ll_configure(), but these can also be created in link_load(),
so that creation needs to also perform sd-event attachment.
Without this, dhcp_client or ipv4ll created in link_load() will not have
an ->event and will fail assertion, causing networkd to fail, e.g.:
Assertion 'client->event' failed at src/libsystemd-network/sd-dhcp-client.c:1283, function client_start_delayed(). Ignoring.
ens2: Could not acquire DHCPv4 lease: Invalid argument
ens2: Failed
This commit is contained in:
parent
12ef8fb6f1
commit
1b43e24602
|
@ -3487,6 +3487,10 @@ network_file_fail:
|
|||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to create DHCPv4 client: %m");
|
||||
|
||||
r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to attach DHCPv4 event: %m");
|
||||
|
||||
r = sd_dhcp_client_set_request_address(link->dhcp_client, &address.in);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to set initial DHCPv4 address %s: %m", dhcp4_address);
|
||||
|
@ -3505,6 +3509,10 @@ dhcp4_address_fail:
|
|||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to create IPv4LL client: %m");
|
||||
|
||||
r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to attach IPv4LL event: %m");
|
||||
|
||||
r = sd_ipv4ll_set_address(link->ipv4ll, &address.in);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Failed to set initial IPv4LL address %s: %m", ipv4ll_address);
|
||||
|
|
Loading…
Reference in New Issue