sd-dhcp-client: only send RENEW message when the client is in bound state
Fixes an issue reported at https://github.com/systemd/systemd/pull/29544#issuecomment-1762742561.
This commit is contained in:
@@ -2161,9 +2161,11 @@ int sd_dhcp_client_send_renew(sd_dhcp_client *client) {
|
||||
assert_return(sd_dhcp_client_is_running(client), -ESTALE);
|
||||
assert_return(client->fd >= 0, -EINVAL);
|
||||
|
||||
if (!client->lease)
|
||||
if (client->state != DHCP_STATE_BOUND)
|
||||
return 0;
|
||||
|
||||
assert(client->lease);
|
||||
|
||||
client->start_delay = 0;
|
||||
client->attempt = 1;
|
||||
client_set_state(client, DHCP_STATE_RENEWING);
|
||||
|
||||
Reference in New Issue
Block a user