14 Mar
2017
14 Mar
'17
10:58 p.m.
On 3/14/17 14:37, John wrote:
""" Normally, UDP pretty much ignores ICMP errors, so if you want to see them, you need to open a raw socket to receive all ICMP packets and look for ones relevant to your socket.
On Linux, at least, an alternative is to set the IP_RECVERR socket option. If you do that, you can do a recvmsg with the MSG_ERRQUEUE flag set to get any ICMP (or other) errors associated with your socket. This has the advantage of not requiring elevated privileges or a second socket. """
http://stackoverflow.com/questions/23118113/c-sockets-send-udp-and-process-i...
The connected UDP socket (second answer) should work fine on Linux to receive ICMP errors for rejected UDP messages. Best Nils