3 ms·
ping is icmp not udp
by riffic 3y ago
ping is icmp not udp
- throwawaymaths 3y agoIt's super confusing because you can use udp to read icmp packets (but not send, iirc), and i might be wrong, but i remember seeing tuts that did this!!
- throwawaymaths 3y agoGetting downvoted, so: https://stackoverflow.com/questions/13087097/how-to-get-icmp-on-udp-socket-on-unix https://stackoverflow.com/questions/13087097/how-to-get-icmp... Using a udp socket is the "classic" way of implementing ping on low privilege syystems
- yencabulator 3y agoYou can kindly ask the kernel networking stack to inform you of errors, but that is not the same as "using udp to read icmp packets".
- dgl 3y ago“udp” in this context means unprivileged data gram, not UDP the protocol. For some reason go uses the confusing “udp” name in parts of its API. The docs for this kind of socket seem to only exist on the kernel commit: https://lwn.net/Articles/420800/ https://lwn.net/Articles/420800/