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-icmp-reply-from-router

The connected UDP socket (second answer) should work fine on Linux to
receive ICMP errors for rejected UDP messages.


Best
  Nils

Reply via email to