]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp4: do not renew address if client is not running yet
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jul 2020 00:43:10 +0000 (09:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jul 2020 01:18:22 +0000 (10:18 +0900)
src/libsystemd-network/sd-dhcp-client.c

index d5f25d5a194e5cf51e3cdd34fe2e2f8c88d0dcde..69589c301bfe520aa3d97e5badda3b3c4e76f324 100644 (file)
@@ -2012,6 +2012,9 @@ int sd_dhcp_client_send_renew(sd_dhcp_client *client) {
         assert_return(client, -EINVAL);
         assert_return(client->fd >= 0, -EINVAL);
 
+        if (IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_INIT_REBOOT, DHCP_STATE_STOPPED))
+                return 0;
+
         client->start_delay = 0;
         client->attempt = 1;
         client->state = DHCP_STATE_RENEWING;