Commit 7edd4961 authored by Christopher Wedgwood's avatar Christopher Wedgwood Committed by Russ Cox

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
https://golang.org/cl/1682043
parent 8bd99ebf
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment