network: do not re-attach sd-event object

Fixes #15126.
This commit is contained in:
Yu Watanabe 2020-03-16 16:17:04 +09:00
parent 74f0fb9095
commit 08c588d18b
2 changed files with 8 additions and 8 deletions

View file

@ -1334,11 +1334,11 @@ int dhcp4_configure(Link *link) {
return log_oom();
if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to create DHCP4 client: %m");
}
r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0);
if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to attach event: %m");
r = sd_dhcp_client_attach_event(link->dhcp_client, NULL, 0);
if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to attach event: %m");
}
r = sd_dhcp_client_set_mac(link->dhcp_client,
(const uint8_t *) &link->mac,

View file

@ -154,6 +154,10 @@ int ipv4ll_configure(Link *link) {
r = sd_ipv4ll_new(&link->ipv4ll);
if (r < 0)
return r;
r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0);
if (r < 0)
return r;
}
if (link->sd_device &&
@ -163,10 +167,6 @@ int ipv4ll_configure(Link *link) {
return r;
}
r = sd_ipv4ll_attach_event(link->ipv4ll, NULL, 0);
if (r < 0)
return r;
r = sd_ipv4ll_set_mac(link->ipv4ll, &link->mac);
if (r < 0)
return r;