1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

DHCPClient: Set ServerIdentifier and RequestedAddress in DHCP REQUESTs

Some dhcp servers require these to be there - otherwise, the ack gets
dropped somewhere.
This commit is contained in:
AnotherTest 2021-02-16 14:25:46 +03:30 committed by Andreas Kling
parent ce3b24723a
commit cc889b3976

View file

@ -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