]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: don't stop the dhcp server if it's not configured. (#7083)
authorSusant Sahani <145210+ssahani@users.noreply.github.com>
Wed, 18 Oct 2017 10:38:56 +0000 (16:08 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 18 Oct 2017 10:38:56 +0000 (12:38 +0200)
we call sd_dhcp_server_stop even if it's not configured when link is
down resulting unwanted logs.
```
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: Lost carrier
Oct 10 13:41:07 nena systemd-networkd[126]: DHCP CLIENT (0x560f2dc5): STOPPED
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: DHCP lease lost
Oct 10 13:41:07 nena systemd-networkd[126]: NDISC: Stopping IPv6 Router Solicitation client
Oct 10 13:41:07 nena systemd-networkd[126]: Assertion 'server' failed at ../src/libsystemd-network/sd-dhcp-server.c:256, function sd_dhcp_server_stop(). Ignoring.
```

fixes #7047

src/network/networkd-link.c

index c581a49b4e77d057fea8f6318d06b7b0c12e1692..70039940bc55ba1238ff499b3f6d70002c1fe94e 100644 (file)
@@ -3085,7 +3085,8 @@ static int link_carrier_lost(Link *link) {
                 return r;
         }
 
-        (void) sd_dhcp_server_stop(link->dhcp_server);
+        if (link_dhcp4_server_enabled(link))
+                (void) sd_dhcp_server_stop(link->dhcp_server);
 
         r = link_drop_config(link);
         if (r < 0)