dhcp4: do not try to renew address when client has no lease

This commit is contained in:
Yu Watanabe 2020-07-07 10:04:42 +09:00
parent ceaec54a3c
commit 921693a0f3
1 changed files with 4 additions and 1 deletions

View File

@ -1441,7 +1441,10 @@ static int client_timeout_t1(sd_event_source *s, uint64_t usec, void *userdata)
sd_dhcp_client *client = userdata;
DHCP_CLIENT_DONT_DESTROY(client);
client->state = DHCP_STATE_RENEWING;
if (client->lease)
client->state = DHCP_STATE_RENEWING;
else if (client->state != DHCP_STATE_INIT)
client->state = DHCP_STATE_INIT_REBOOT;
client->attempt = 0;
return client_initialize_time_events(client);