Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Need a way to detect ICMP errors with UDP. #1985

kirm opened this Issue · 7 comments

6 participants


I implemented SIP stack for node. SIP standard requires me to handle ICMP errors properly, but it seems there is no way to detect them in node.js v0.5.

AFAIK most UNIX systems report ICMP errors as errors in recvmsg syscall on connected udp sockets only. Before v0.5 i was able to hack around dgram module and call process.bindings('net').connect on socket and got those error reports.

On windows, system reports icmp errors as error codes in WSARecvFrom, and returns ICMP packet source address in lpFrom parameter, but node.js doesn't pass it to user.

@kirm kirm closed this
@kirm kirm reopened this

It was a conscious decision to not propagate network errors because Linux is the only supported UNIX flavour that reports them in a reasonable way. SunOS and the BSDs report ICMP errors only in connected mode - which our sockets never are.

I don't really want to add a special case hack to libuv just for this but I can see why it be useful to some.

@piscisaureus: What do you think?


Why not just allow users to connect their udp sockets and handle network errors in portable way?


Since this is a design decision I'm marking this a feature request while it's being considered.


@bnoordhuis @piscisaureus Any update on this?


No. I think it's fair to say that (almost) no one cares.


UDP sockets can be connected. I don't see a reason why node should not expose the system call for UDP sockets, just map it 1:1 to ::connect(). It makes it easier to send packets, makes it possible to filter junk out coming from unwanted addresses, and last but not least it makes it possible to report ICMP packets. This is mandatory for SIP IPv6 compliance tests. No big deal IMHO.


Closing to apparent lack of interest. Can reopen if new information is received.

@jasnell jasnell closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.