I have noticed that UDP datagrams sent to a linux host will cause that host to send back ICMP type 3
packets saying "destination unreachable" even when you have used bind on the receving host to the
port in question and can see that using /sbin/route. This can play havoc with the sending unit, which in
my case is a BF537 which is very busy.
You can see this happen using wireshark or tcpdump.
There are some solutions given for that that involve setting things in the proc filesystem but I have not found
that to work for me. Here is what worked on my system:
/sbin/iptables -A OUTPUT -p ICMP --icmp-type 3 -j DROP
I spent a long time on this before and actually bought a smart switch to filter these out because I
couldn't figure it out a few years ago.
There may be some trick to use in bind but I don't know that. It would be better if that were so in order
to avoid doing something to the host system. But anyway this works. I found it on the internets but I
forgot where and it had to be modified to work anyway.
BTW I am using a non blocking recvfrom, which may be part of the problem