-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protocol/icmp在IPv6下recvfrom返回错误 #613
Comments
通过so_rcvtimeo设置了接收超时的,windows 10060和linux 11错误码都是超时未收到响应导致的,这个是正常现象 |
但我把超时时间设置为30秒都显示超时状态,ping ipv4地址就正常返回,地址使用系统ping程序都是正常能ping通的。 |
我发现有个socket选项可能没用适配ipv6,把IPPROTO_ICMP改成IPPROTO_ICMPV6试试呢 |
修改成:int sockfd = socket(peeraddr.sa.sa_family, SOCK_RAW, peeraddr.sa.sa_family == AF_INET6 ? IPPROTO_ICMPV6 : IPPROTO_ICMP); 还是一样的运行结果 |
应该是ICMPV6和ICMP的报文内容也不同,需要详细研究下 |
protocol/icmp在IPv6下无法使用, sendto调用正常返回,windows下recvfrom时错误代码10060, linux下错误代码 11
The text was updated successfully, but these errors were encountered: