summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Wedgwood <cw@f00f.org>2010-06-21 16:40:44 -0700
committerChristopher Wedgwood <cw@f00f.org>2010-06-21 16:40:44 -0700
commit1487ad74e3e0f276641358936c34583bc90a38d8 (patch)
treeeec0ddd52e089e512e9d2687d3c1fc1679be3631
parent6db1696c856048832d44862045474d5685c3a894 (diff)
downloadgolang-1487ad74e3e0f276641358936c34583bc90a38d8.tar.gz
net: Fix ICMP test.
Ping IDs should be limited to 16-bits. Fix failure printing. R=rsc CC=golang-dev, jean-christophe smith <jeanchristophe.smith http://codereview.appspot.com/1682043 Committer: Russ Cox <rsc@golang.org>
-rw-r--r--src/pkg/net/ipraw_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/net/ipraw_test.go b/src/pkg/net/ipraw_test.go
index 6d9fb965a..562298bdf 100644
--- a/src/pkg/net/ipraw_test.go
+++ b/src/pkg/net/ipraw_test.go
@@ -87,7 +87,7 @@ func TestICMP(t *testing.T) {
t.Fatalf(`net.ListenIP("ip4:icmp", %v) = %v, %v`, *srchost, c, err)
}
- sendid := os.Getpid()
+ sendid := os.Getpid() & 0xffff
const sendseq = 61455
const pingpktlen = 128
sendpkt := makePingRequest(sendid, sendseq, pingpktlen, []byte("Go Go Gadget Ping!!!"))
@@ -109,7 +109,7 @@ func TestICMP(t *testing.T) {
}
rcvid, rcvseq := parsePingReply(resp)
if rcvid != sendid || rcvseq != sendseq {
- t.Fatal(`Ping reply saw id,seq=%v,%v (expected %v, %v)`, rcvid, rcvseq, sendid, sendseq)
+ t.Fatalf(`Ping reply saw id,seq=0x%x,0x%x (expected 0x%x, 0x%x)`, rcvid, rcvseq, sendid, sendseq)
}
return
}