Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Revision 185:e8f516e142c4, committed 2021-01-14
- 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