From 6b360834f2cb679edcb1daa92011ba2238e85242 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 4 Apr 2021 23:17:07 +0300 Subject: [PATCH] DHCPClient: Dont set DHCPOption::ServerIdentifier on DHCPRequest Some real DHCP servers dont set the siaddr field in the DHCPOffer to their IPv4 (and instead leave it blank - 0.0.0.0), which results in the server assuming the DHCPRequest is not directed at him when it has the ServerIdentifier option attached that specifies 0.0.0.0 as the targeted server. So instead we just omit the option and let the DHCP servers decipher the target themselves based on the requested IP. --- Userland/Services/DHCPClient/DHCPv4Client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 8bf421ab81..73a377deb2 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -287,7 +287,6 @@ void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, const DHCPv4Pack // set packet options builder.set_message_type(DHCPMessageType::DHCPRequest); - builder.add_option(DHCPOption::ServerIdentifier, sizeof(IPv4Address), &offer.siaddr()); builder.add_option(DHCPOption::RequestedIPAddress, sizeof(IPv4Address), &offer.yiaddr()); auto& dhcp_packet = builder.build();