From 4b01ff9f8aedf62e9f7c4d268770c2f31317c3fe Mon Sep 17 00:00:00 2001 From: DrDoof <8052722+DrDoof@users.noreply.github.com> Date: Fri, 25 Sep 2026 06:14:39 +0200 Subject: [PATCH] dhcp: drop the MAC copy after the requested IP and server id dhcp_addopt_request_ip() and dhcp_addopt_server_id() both end with a copy of four bytes of our MAC to the current position, without moving the position on. The next option always starts there, so those bytes are written over before the packet goes out and never reach the wire. The packet stays the same without the copy, and BANK3 is 102 bytes smaller on the KP_9000_6XHML_X2. --- dhcp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dhcp.c b/dhcp.c index 2fbce36c..29ddfab6 100644 --- a/dhcp.c +++ b/dhcp.c @@ -139,7 +139,6 @@ void dhcp_addopt_request_ip(void) DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.current_ip[1]; DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.current_ip[2]; DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.current_ip[3]; - memcpy(&DHCP_OPT[dhcp_state.opt_ptr], uip_ethaddr.addr, 4); } @@ -151,7 +150,6 @@ void dhcp_addopt_server_id(void) DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.server[1]; DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.server[2]; DHCP_OPT[dhcp_state.opt_ptr++] = dhcp_state.server[3]; - memcpy(&DHCP_OPT[dhcp_state.opt_ptr], uip_ethaddr.addr, 4); }