From: Yu Watanabe Date: Tue, 7 Jul 2020 01:04:42 +0000 (+0900) Subject: dhcp4: do not try to renew address when client has no lease X-Git-Tag: v246-rc1~24^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=921693a0f386b01fb755d044f7345b1d00bf4a05;p=thirdparty%2Fsystemd.git dhcp4: do not try to renew address when client has no lease --- diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 69589c301bf..ef24b9c4def 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -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);