From ce3b24723aec0b8542790f118f10810744c35ba9 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 15 Feb 2021 21:38:05 +0330 Subject: [PATCH] DHCPClient: Set the client IP field of the DHCP DISCOVER message This is the field that tells the DHCP server which IP we want, not setting it is quite silly :P --- Userland/Services/DHCPClient/DHCPv4Client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 945b2b54a4..61ee0c60fa 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -276,6 +276,7 @@ void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, const DHCPv4Pack DHCPv4Packet& packet = builder.peek(); packet.set_op(DHCPv4Op::BootRequest); + packet.ciaddr() = offer.yiaddr(); packet.set_htype(1); // 10mb ethernet packet.set_hlen(sizeof(MACAddress)); packet.set_xid(offer.xid());