summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-04 23:17:07 +0300
committerAndreas Kling <kling@serenityos.org>2021-04-04 22:38:27 +0200
commit6b360834f2cb679edcb1daa92011ba2238e85242 (patch)
tree70f362f0be62a58f5b5c4b32728b3dd483f52777 /Userland/Services
parent47fa8d83bbeeac0ba607f62f41ab64cc179d0638 (diff)
downloadserenity-6b360834f2cb679edcb1daa92011ba2238e85242.zip
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.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/DHCPClient/DHCPv4Client.cpp1
1 files changed, 0 insertions, 1 deletions
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();