6
votes

My server listens on a UDP port and also receives broadcast messages. Can I detect somehow if the received message was sent to my ip directly or to a broadcast address? rinfo just gives me the sender information

1
I did UDP stuff, but never done broadcast stuff, so this is simply my impression. If you find there is no way to do that in the end, I would recommend you to have separate receivers for each of direct and broadcast messages. Good luck.user1028880

1 Answers

4
votes

It is currently not possible.

See this Github bug link

Workaround:

  • have different internal ports for the broadcast and the normal traffic.
  • Use iptables to redirect broadcast traffic to one of the internal port and the other traffic to the other port.