A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: udp/dhcp.cpp
- Revision:
- 28:edc17eeb4142
- Parent:
- 14:e75a59c1123d
- Child:
- 29:39277bf2003d
diff -r 1d9a3d72b6dd -r edc17eeb4142 udp/dhcp.cpp --- a/udp/dhcp.cpp Wed Jul 05 13:46:04 2017 +0000 +++ b/udp/dhcp.cpp Mon Jul 24 15:27:36 2017 +0000 @@ -235,11 +235,12 @@ uint32_t siaddr = pHeader->siaddr; uint32_t cookie = NetToHost32(pHeader->cookie); - if (op != REPLY) return DO_NOTHING; - if (htype != ETHERNET) return DO_NOTHING; - if (hlen != 6) return DO_NOTHING; - if (xid != ID) return DO_NOTHING; - if (cookie != COOKIE) return DO_NOTHING; + if (op != REPLY) return DO_NOTHING; + if (htype != ETHERNET) return DO_NOTHING; + if (hlen != 6) return DO_NOTHING; + if (memcmp(pHeader->chaddr, MacLocal, 6)) return DO_NOTHING; + if (xid != ID) return DO_NOTHING; + if (cookie != COOKIE) return DO_NOTHING; char* pOptions = (char*)pPacket + HEADER_LENGTH; readOptions(*pSize - HEADER_LENGTH, pOptions);