dhcp4: do not renew address if client is not running yet

This commit is contained in:
Yu Watanabe 2020-07-07 09:43:10 +09:00
parent c82012605b
commit ceaec54a3c
1 changed files with 3 additions and 0 deletions

View 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;