joyent/node — Issue #1985: Need a way to detect ICMP errors with UDP.
Author: kirm
Created: 2011-11-01 18:01:49+00:00
State: open

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.