]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: unconditionally set sd_dhcp_client.request_sent when a packet is...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Nov 2023 17:14:59 +0000 (02:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Nov 2023 17:18:15 +0000 (02:18 +0900)
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

index 8a94685ba7c2c8ea6f69611e6cc9b1f1ec080794..bbe0b5227b8a70c6918ddf58a3518b032dc3f4cd 100644 (file)
@@ -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: