[En-Nut-Discussion] Nut/OS 3.2 DHCP Patch
Harald Kipp
harald.kipp at egnite.de
Fri May 9 11:10:37 CEST 2003
Tomohiro Haraikawa provided the following patch to Version 3.2
pro/dhcpc.c
2) Incompatibility with some DHCP servers including broadband
routers
Some DHCP servers discard Nut/NET DHCP discover telegram
because it doesn't satisfy upward compatibility with BOOTP
packet. Most DHCP clients pad NULs to make the packet len-
gth to 300 octets.
==================================================================
333a334
> u_short len;
340,341c341,346
< return NutUdpSendTo(sock, daddr, dport, bp,
< (u_short) cp - (u_short) bp);
---
> /* DHCP discover telegram should be upward compatible with BOOTP */
> len = (u_short) cp - (u_short) bp;
> if (len < (char *)&bp->bp_options - (char *)bp + 64)
> len = (char *)&bp->bp_options - (char *)bp + 64;
>
> return NutUdpSendTo(sock, daddr, dport, bp, len);
==================================================================
Many thanks,
Harald
More information about the En-Nut-Discussion
mailing list