]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not trigger assertion by forcerenew command 29544/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Oct 2023 09:38:01 +0000 (18:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Oct 2023 09:38:04 +0000 (18:38 +0900)
When DHCP server is not running, sending force-renew command triggers
assertion.

src/network/networkd-link-bus.c

index a42eb8dd63df0124aef1ba892e3519f6abcd9f50..5fd5734ce06f12c05201fcf4e4140132a681f3c9 100644 (file)
@@ -599,7 +599,7 @@ int bus_link_method_force_renew(sd_bus_message *message, void *userdata, sd_bus_
         if (r == 0)
                 return 1; /* Polkit will call us back */
 
-        if (l->dhcp_server) {
+        if (sd_dhcp_server_is_running(l->dhcp_server)) {
                 r = sd_dhcp_server_forcerenew(l->dhcp_server);
                 if (r < 0)
                         return r;