Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: ListenIP doesn't support Linux-specific ICMP echo-only socket #9166
I want to open a ping socket, but I can't because `net.ListenIP("ip4:icmp", ...)` always uses type=SOCK_RAW. However, for "ip4:icmp" / "ip6:ipv6-icmp" it should use type=SOCK_DGRAM. I also can't work around it by using `net.ListenUDP` because that always uses proto=0 (= default = UDP for SOCK_DGRAM).  https://code.google.com/p/go/source/browse/src/net/iprawsock_posix.go
Thanks but no thanks. it's a protocol stack inside Linux kernel specific feature, also it cannot receive/send other ICMP type messages. You can make your Linux+ICMP echo-specific socket using syscall.Socket and make it run with runtime-integrated network poller by using net.FilePacketConn.
Labels changed: added repo-main.
Status changed to Unfortunate.