mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
DHCPClient: Send ServerIdentifier option with DHCPRequest packet
Some DHCP servers (including Mikrotik ones) will NAK the request if the ServerIdentifier option is not sent with the DHCPRequest packet.
This commit is contained in:
parent
fa18c283dc
commit
01a602cb51
Notes:
sideshowbarker
2024-07-17 11:44:36 +09:00
Author: https://github.com/fluxth Commit: https://github.com/SerenityOS/serenity/commit/01a602cb51 Pull-request: https://github.com/SerenityOS/serenity/pull/13678 Reviewed-by: https://github.com/alimpfard
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, the SerenityOS developers.
|
||||
* Copyright (c) 2020-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -361,6 +361,11 @@ void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet con
|
|||
// set packet options
|
||||
builder.set_message_type(DHCPMessageType::DHCPRequest);
|
||||
builder.add_option(DHCPOption::RequestedIPAddress, sizeof(IPv4Address), &offer.yiaddr());
|
||||
|
||||
auto maybe_dhcp_server_ip = offer.parse_options().get<IPv4Address>(DHCPOption::ServerIdentifier);
|
||||
if (maybe_dhcp_server_ip.has_value())
|
||||
builder.add_option(DHCPOption::ServerIdentifier, sizeof(IPv4Address), &maybe_dhcp_server_ip.value());
|
||||
|
||||
auto& dhcp_packet = builder.build();
|
||||
|
||||
// broadcast the "request" request
|
||||
|
|
Loading…
Add table
Reference in a new issue