diff options
author | 2018-12-28 06:34:43 +0000 | |
---|---|---|
committer | 2018-12-28 15:34:43 +0900 | |
commit | 7da7340afdd4760fb2dd9d000105c324a77aff4b (patch) | |
tree | 21f12eeea641de99dd7eca007232af0b2a5a2c13 | |
parent | meson: use cross compilation compatible c++ check (diff) | |
download | systemd-7da7340afdd4760fb2dd9d000105c324a77aff4b.tar.gz systemd-7da7340afdd4760fb2dd9d000105c324a77aff4b.tar.bz2 systemd-7da7340afdd4760fb2dd9d000105c324a77aff4b.zip |
Do not start server if it is already runnning (#11245)
-rw-r--r-- | src/network/networkd-link.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index e2851df31..cadf7f8b0 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1207,15 +1207,16 @@ static int link_request_set_addresses(Link *link) { return r; } } + if (!sd_dhcp_server_is_running(link->dhcp_server)) { + r = sd_dhcp_server_start(link->dhcp_server); + if (r < 0) { + log_link_warning_errno(link, r, "Could not start DHCPv4 server instance: %m"); - r = sd_dhcp_server_start(link->dhcp_server); - if (r < 0) { - log_link_warning_errno(link, r, "Could not start DHCPv4 server instance: %m"); - - link_enter_failed(link); + link_enter_failed(link); - return 0; - } + return 0; + } + } log_link_debug(link, "Offering DHCPv4 leases"); } |