From 089362976c2a653a77f942bfeb3f61d0e180f078 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 8 Nov 2023 02:14:59 +0900 Subject: [PATCH] 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. --- src/libsystemd-network/sd-dhcp-client.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 8a94685ba7..bbe0b5227b 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: