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
x/net/icmp: support windows #9253
Comments
what we need to do here is, a) enabling listenpacket and confirming it works well on windows using ping_test.go, b) verifying parseipv4header works correctly on windows by comparing wire data. |
ping_test.go is work on windows. |
Thanks. Can you also confirm that the behavior of Windows ICMP? Does icmp.ParseIPv4Header on Windows parse an IPv4 header in some ICMP error message such as destination unreachable correctly? |
TestMarshalAndParseMessageForIPv4 is working too on windows. Do you want additional tests? |
No, we need to add some to TestMarshalAndParseMessageForIPv4 if needed. It depends on Windows' implementation but icmp.ParseIPv4Header must handle correctly even if Windows stack tweaks a few fields of original IPv4 header in ICMP error message, such as Darwin and FreeBSD. You can use ping_test.go with a small modification, just using ipv4.PacketConn.SetTTL, to send a TTL=1 ICMP packet and to receive an ICMP time exceeded error message on Window. |
I modified like below. And test passed. Is this right? |
Please try http://play.golang.org/p/fXWPqxlMf6 with administrator privilege. If everything goes well it displays original IPv4 header in ICMP error message as follows: then, please compare captured wire data using wireshark or other, and fix ParseIPv4Header and wire data for TestParseIPv4Header if needed. Thanks. |
I'm waiting 10 minutes after start |
Ooops, sorry. After I disabled Windows Firewall, tests passed.
|
Try "go test -v -run TestPingIPv4" |
Is it same with the captured wire data using wireshark or other? If so, no need to modify ParseIPv4Header, and I will take a look at your CL. |
We need a returned ICMP time exceeded message which type is 0xb, not an echo, type=0x8, message. Sorry for the confusion. |
NP :) Are you going to write test code once more? |
Nope, sorry for my laziness. We know we can make a few tapped-test cases by using code.google.com/p/gopacket or PCAP/PF_RING/AF_PACKET/BPF directly, but I won't. |
Below is a byte dump of TimeExceeded message.
I checked checksum. It's right. Sorry I had looked send package instead of receive packet. But Wireshark seems not capture response from localhost without PCAP. |
If you want, I can send e-mail to tell you my IP-Address. |
@mikioh How about this? I modified IP address for the test. |
No description provided.
The text was updated successfully, but these errors were encountered: