From e9171d7d228a456dd1dd5a1e67109b05b75f4e5b Mon Sep 17 00:00:00 2001 From: logicog Date: Wed, 7 Jan 2026 11:32:47 +0100 Subject: [PATCH] Handle outgoing DHCP server messages correctly --- uip/uip_arp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uip/uip_arp.c b/uip/uip_arp.c index 362b1b8..90fe6e9 100644 --- a/uip/uip_arp.c +++ b/uip/uip_arp.c @@ -106,6 +106,7 @@ struct ethip_hdr { u16_t ipchksum; u16_t srcipaddr[2], destipaddr[2]; + u16_t sport, dport; }; #define ARP_REQUEST 1 @@ -370,6 +371,11 @@ uip_arp_out(void) __banked If not ARP table entry is found, we overwrite the original IP packet with an ARP request for the IP address. */ + if (IPBUF->sport == 0x4300 && !IPBUF->destipaddr[0] && !IPBUF->destipaddr[1]) { + IPBUF->destipaddr[0] = 0xffff; + IPBUF->destipaddr[1] = 0xffff; + IPBUF->dport = 0x4400; + } /* First check if destination is a local broadcast. */ if(uip_ipaddr_cmpc(IPBUF->destipaddr, broadcast_ipaddr)) { memcpyc(IPBUF->ethhdr.dest.addr, broadcast_ethaddr.addr, 6);