DHCP INFORM coming from server rather than from client
This post was updated on .
I am using an ENC28J60 with a CC1352p1 and LWIP to set up a networking stack.
I am trying to assign my device an IP address using the DHCP protocol. I'm
able to send a DHCP DISCOVER message from my device (client with MAC address
74:69:69:2d:30:31) to the DHCP server (which is running on my PC with MAC
I then get a DHCP OFFER from the server: It has the SRC MAC address of my
computer, DST MAC of my device, and assigns an IP of 192.168.1.100 to my
device. I can confirm that the device actually sees the OFFER packet as I
can see the contents of the packet in the code when I debug.
I can then see in Wireshark, a DHCP Inform. I assumed this meant that it was
requesting more information, but I thought DHCP Inform is supposed to come
from the client to server - in this case, from the device to my computer!
According to Wireshark though, the DHCP Inform is being broadcasted from the
server, i.e. my computer.
DHCP Inform :
Moreover, the inform packet lists b0:0c:d1:4c:15:5f as the client MAC address when in fact it is the server MAC address!
I've attached the Wireshark capture illustrating what happens when I send a
DHCP Discover. I get the Offer, and then get an inform, but I don't get a
request from my device - I can go into ip_input() and see the DHCPOffer
packet of length 342 in that function, so I know it's being processed.
If the DHCP Inform that I'm seeing is completely independent of the DHCP
Discover/Offer, then the issue seems to be that the Offer is being ignored
by the client. Correct, 192.168.1.11 is my computer, and the Server on my
computer assigns with Offer assigns an IP of 192.168.1.100 to my client
which is the CC1352P1.
I fixed the issue with the malformed DHCP packet - it was an issue with the ethernet driver that I wrote, very low level and had to do with using a uint8_t instead of a larger integer to store the length of the packet so that it couldn't handle packets larger than 256 bytes. (Dumb, I know). Commented on that post!