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
This commit is contained in:
AnotherTest 2021-02-15 21:38:05 +03:30 committed by Andreas Kling
commit ce3b24723a
Notes: sideshowbarker 2024-07-18 22:12:07 +09:00

View file

@ -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());