diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-16 14:25:46 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-17 14:41:36 +0100 |
commit | cc889b397608d1fa8ae84a8753dcddc64d3c5389 (patch) | |
tree | 1872021fe43a838931d07f75a5e53dbd11d5bf5d /Userland/Services | |
parent | ce3b24723aec0b8542790f118f10810744c35ba9 (diff) | |
download | serenity-cc889b397608d1fa8ae84a8753dcddc64d3c5389.zip |
DHCPClient: Set ServerIdentifier and RequestedAddress in DHCP REQUESTs
Some dhcp servers require these to be there - otherwise, the ack gets
dropped somewhere.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/DHCPClient/DHCPv4Client.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 61ee0c60fa..6c427cbdca 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -286,6 +286,8 @@ 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(); // broadcast the "request" request |