From cc889b397608d1fa8ae84a8753dcddc64d3c5389 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 16 Feb 2021 14:25:46 +0330 Subject: [PATCH] DHCPClient: Set ServerIdentifier and RequestedAddress in DHCP REQUESTs Some dhcp servers require these to be there - otherwise, the ack gets dropped somewhere. --- Userland/Services/DHCPClient/DHCPv4Client.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 61ee0c60fab..6c427cbdcae 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