sd-dhcp-client: gracefully ignore OFFER with Rapid Commit option

Fixes #29904.
This commit is contained in:
Yu Watanabe
2023-11-07 22:41:37 +09:00
committed by Lennart Poettering
parent 5568043a84
commit c4efe0e51e

View 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