mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
DHCPClient: Send ParameterRequestList option with DHCPRequest packet
We'll need SubnetMask and Router options to be returned with the ACK packet. So, it's a good idea to request them explicitly in this packet.
This commit is contained in:
parent
01a602cb51
commit
c949a4db2d
Notes:
sideshowbarker
2024-07-17 11:44:31 +09:00
Author: https://github.com/fluxth Commit: https://github.com/SerenityOS/serenity/commit/c949a4db2d Pull-request: https://github.com/SerenityOS/serenity/pull/13678 Reviewed-by: https://github.com/alimpfard
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "DHCPv4Client.h"
|
||||
#include <AK/Array.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
|
@ -366,6 +367,12 @@ void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet con
|
|||
if (maybe_dhcp_server_ip.has_value())
|
||||
builder.add_option(DHCPOption::ServerIdentifier, sizeof(IPv4Address), &maybe_dhcp_server_ip.value());
|
||||
|
||||
AK::Array<DHCPOption, 2> parameter_request_list = {
|
||||
DHCPOption::SubnetMask,
|
||||
DHCPOption::Router,
|
||||
};
|
||||
builder.add_option(DHCPOption::ParameterRequestList, parameter_request_list.size(), ¶meter_request_list);
|
||||
|
||||
auto& dhcp_packet = builder.build();
|
||||
|
||||
// broadcast the "request" request
|
||||
|
|
Loading…
Add table
Reference in a new issue