如下代码,在 windows 上收不上来 time exceeded 的包,但是 wireshark 上可以抓到。
同样的代码在 linux 上就是好使的。
有没有小伙伴知道是啥原因啊?
同样的代码在 linux 上就是好使的。
有没有小伙伴知道是啥原因啊?
1
katsusan Jan 5, 2019
https://godoc.org/golang.org/x/net/icmp#ListenPacket
ListenPacket listens for incoming ICMP packets addressed to address. See net.Dial for the syntax of address. For non-privileged datagram-oriented ICMP endpoints, network must be "udp4" or "udp6". The endpoint allows to read, write a few limited ICMP messages such as echo request and echo reply. Currently only Darwin and Linux support this. 看下面的 example 里 windows 好像是不支持的. |