cannot receive UDP broadcast packets
- by user292792
Hello
I have 2 boxes:
- an embedded device (ARM Omap with linux) which I'll call "Omap".
- a PC (can either be Windows or linux).
Scenario 1
Both boxes are in the same network (example: my office).
The Omap gets its address from a DHCP server (ex: 192.168.10.110). The PC has always the same address (ex. 192.168.10.104).
I can successfully exchange UDP broadcast packets on any port.
Success.
Scenario 2
The 2 boxes are in a network withOUT a DHCP server.
The PC has a static IP address (example: 10.10.10.20).
The Omap boots, looks for a DHCP server, doesn't find it, and is in what I call "bad IP address" state.
Now... Broadcasting UDP packets from the Omap works: the PC can see them.
The opposite doesn't work: UDP packets broadcasted by the PC are not seen by the Omap.
I am using Wireshark on another PC to verify that the packets are being sent.
Failure.
I tried to change the Omap ip address (with ifconfig)... no luck.
What am I missing?
To complete the picture, when the Omap is in Scenario 2, if I run udhcpc ... it can communicate with the DHCP server and get an IP address. I also see the packets with Wireshark.
So this means that the DHCP client is able to broadcast UDP packets.
(Yes, I tried to use DHCP ports 67/68 but it doesn't work).
I am using Boost C++ Asio UDP sockets. Specifically, I took the multicast examples and changed them to do broadcasting.
Any help is appreciated.
Thanks,
Benedetto