From: Yu Watanabe Date: Tue, 7 Nov 2023 17:14:59 +0000 (+0900) Subject: sd-dhcp-client: unconditionally set sd_dhcp_client.request_sent when a packet is... X-Git-Tag: v255-rc2~88^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=089362976c2a653a77f942bfeb3f61d0e180f078;p=thirdparty%2Fsystemd.git sd-dhcp-client: unconditionally set sd_dhcp_client.request_sent when a packet is sent If a server replies an ACK for the initial DISCOVER, previously request_sent was not set, so networkd handle the lease timed out. Follow-up for 808b65a08729caa268efd57c478285ee4912d5a3. --- diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 8a94685ba7c..bbe0b5227b8 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -1367,6 +1367,7 @@ static int client_timeout_resend( } else if (client->attempt >= client->max_attempts) goto error; + client->request_sent = time_now; break; case DHCP_STATE_SELECTING: @@ -1374,9 +1375,7 @@ static int client_timeout_resend( if (r < 0 && client->attempt >= client->max_attempts) goto error; - if (client->rapid_commit) - client->request_sent = time_now; - + client->request_sent = time_now; break; case DHCP_STATE_INIT_REBOOT: