Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Thu Jan 14 14:18:59 2021 +0000
Parent:
184:ad80a63e3002
Child:
186:24198369b198
Commit message:
DHCP - Zeroed the unused client hardware bytes (last ten of sixteen) as I noticed in wireshark that where they had changed between discover and request is when the server was returning a NAK; may just have been a coincidence however.

Changed in this revision

udp/dhcp/dhcp.c Show annotated file Show diff for this revision Revisions of this file
--- a/udp/dhcp/dhcp.c	Thu Jan 14 13:41:02 2021 +0000
+++ b/udp/dhcp/dhcp.c	Thu Jan 14 14:18:59 2021 +0000
@@ -258,6 +258,7 @@
     DhcpHdrSetSiaddr(pPacket, 0                  ); //'Server' address to use if required
     DhcpHdrSetGiaddr(pPacket, 0                  ); //'Gateway' address
     memcpy(DhcpHdrPtrChaddr(pPacket), MacLocal, 6); //'Client hardware' address. 6 bytes for ethernet
+    memset(DhcpHdrPtrChaddr(pPacket) + 6, 0, 10  ); //Pad the remainder of the hardware address field with zeros
     memset(DhcpHdrPtrLegacy(pPacket), 0, 192     ); //BootP legacy fill with zeros
     DhcpHdrSetCookie(pPacket, COOKIE             ); //Magic cookie