mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
network: restart DHCP server on carrier gain
This commit is contained in:
parent
b27e5d53f3
commit
ab486ef4eb
@ -445,13 +445,11 @@ static int dhcp4_server_configure(Link *link) {
|
||||
return log_link_error_errno(link, r, "Failed to set DHCPv4 static lease for DHCP server: %m");
|
||||
}
|
||||
|
||||
if (!sd_dhcp_server_is_running(link->dhcp_server)) {
|
||||
r = sd_dhcp_server_start(link->dhcp_server);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not start DHCPv4 server instance: %m");
|
||||
|
||||
log_link_debug(link, "Offering DHCPv4 leases");
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1209,6 +1209,12 @@ static int link_acquire_ipv4_conf(Link *link) {
|
||||
return log_link_warning_errno(link, r, "Could not acquire IPv4 link-local address: %m");
|
||||
}
|
||||
|
||||
if (link->dhcp_server) {
|
||||
r = sd_dhcp_server_start(link->dhcp_server);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Could not start DHCP server: %m");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user