]> Cypherpunks repositories - gostls13.git/commitdiff
net: default to 127.0.0.1, not localhost, in TestICMP
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 2 May 2011 21:22:40 +0000 (14:22 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 2 May 2011 21:22:40 +0000 (14:22 -0700)
If localhost resolves to ::1, the IPv4-only test fails.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4444084

src/pkg/net/ipraw_test.go

index ee8c71fc19fc640a98b55bbb08089a1a03e12b32..0c0b675f875929b72bf4d888c1b72517d16faf19 100644 (file)
@@ -60,7 +60,8 @@ func parsePingReply(p []byte) (id, seq int) {
 }
 
 var srchost = flag.String("srchost", "", "Source of the ICMP ECHO request")
-var dsthost = flag.String("dsthost", "localhost", "Destination for the ICMP ECHO request")
+// 127.0.0.1 because this is an IPv4-specific test.
+var dsthost = flag.String("dsthost", "127.0.0.1", "Destination for the ICMP ECHO request")
 
 // test (raw) IP socket using ICMP
 func TestICMP(t *testing.T) {