On Fri, Nov 19, 2021 at 1:01 PM Joel Knight <[email protected]> wrote:
>
> One thing that got missed in the refactor was that the requested-ip
> option should not be set in a RENEWING or BINDING state (or in other
> words, when ciaddr is set). This chunk on top of your diff also works
> as expected (successful unicast renewal at T1).
Hi Florian,
Does the chunk below make sense?
> Index: frontend.c
> ===================================================================
> RCS file: /data/cvs-mirror/OpenBSD/src/sbin/dhcpleased/frontend.c,v
> retrieving revision 1.23
> diff -p -u -r1.23 frontend.c
> --- frontend.c 20 Oct 2021 07:04:49 -0000 1.23
> +++ frontend.c 19 Nov 2021 16:25:18 -0000
> @@ -963,11 +966,13 @@ build_packet(uint8_t message_type, char
> p += sizeof(dhcp_req_list);
>
> if (message_type == DHCPREQUEST) {
> - memcpy(dhcp_requested_address + 2, requested_ip,
> - sizeof(*requested_ip));
> - memcpy(p, dhcp_requested_address,
> - sizeof(dhcp_requested_address));
> - p += sizeof(dhcp_requested_address);
> + if (ciaddr->s_addr == 0) {
> + memcpy(dhcp_requested_address + 2, requested_ip,
> + sizeof(*requested_ip));
> + memcpy(p, dhcp_requested_address,
> + sizeof(dhcp_requested_address));
> + p += sizeof(dhcp_requested_address);
> + }
>
> if (server_identifier->s_addr != INADDR_ANY) {
> memcpy(dhcp_server_identifier + 2, server_identifier,