in reply to Re: udp recv question
in thread udp recv question

How can I get "ICMP error back from my UDP message"
This may work as advertised on your OS ( Linux? ), but on Win2K returns recv: Unknown error. The above link explains why it works for some Linux implementations.

UDP is a connectionless protocol ( There is not TTL added to the message so ICMP is not guaranteed! ) If you want to see what makes up it message IP Message Formats
Cheers!
JamesNC

Replies are listed 'Best First'.
Re^3: udp recv question
by dave_the_m (Monsignor) on Jun 29, 2004 at 12:31 UTC
    This may work as advertised on your OS ( Linux? ), but on Win2K returns recv: Unknown error. The above link explains why it works for some Linux implementations.
    I tested it on Solaris. It should work on any decent OS. The link you gave refers to this working with unconnected sockets, which seems to be a linux-specific feature, but by adding the PeerAddr parameter, perl creates a connected socket, which should allow any errors to be reported by the OS. It looks like even W2K is reporting the returned ICMP, just not with a very helpful error number.

    Of course with UDP and ICMP you're never guaranteed a reply, but that's not due to TTLs - all IP packets, including UDP and ICMP, have TTL fields.

    Dave.