]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: gracefully ignore OFFER with Rapid Commit option
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Nov 2023 13:41:37 +0000 (22:41 +0900)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Nov 2023 15:13:54 +0000 (16:13 +0100)
Fixes #29904.

src/libsystemd-network/sd-dhcp-client.c

index 97250d47e8402cb5057421b44963a4b390fb8fea..8a94685ba7c2c8ea6f69611e6cc9b1f1ec080794 100644 (file)
@@ -1609,9 +1609,13 @@ static int client_parse_message(
                                 return log_dhcp_client_errno(client, SYNTHETIC_ERRNO(ENOMSG),
                                                              "received rapid ACK without Rapid Commit option, ignoring.");
                 } else if (r == DHCP_OFFER) {
-                        if (lease->rapid_commit)
-                                return log_dhcp_client_errno(client, SYNTHETIC_ERRNO(ENOMSG),
-                                                             "received OFFER with Rapid Commit option, ignoring");
+                        if (lease->rapid_commit) {
+                                /* Some RFC incompliant servers provides an OFFER with a rapid commit option.
+                                 * See https://github.com/systemd/systemd/issues/29904.
+                                 * Let's support such servers gracefully. */
+                                log_dhcp_client(client, "received OFFER with Rapid Commit option, ignoring.");
+                                lease->rapid_commit = false;
+                        }
                         if (lease->lifetime == 0 && client->fallback_lease_lifetime > 0)
                                 lease->lifetime = client->fallback_lease_lifetime;
                 } else