chiark / gitweb /
stest: Check that received packet is as expected
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Nov 2019 00:59:39 +0000 (00:59 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 13:15:49 +0000 (13:15 +0000)
commitc9b81d7160651322ed81520e851152e9e9fb2644
tree244eff83e9637d67eb1df04e949c607719c420a8
parentd939e5444828922f90b2646405025b4dd81f8988
stest: Check that received packet is as expected

It turns out that if secnet decides the link to the peer is too
broken, it loops outbound packets back to its host.  Normally this is
not obvious, because the host naturally drops such packets.

But in stest we weren't actually looking at the incoming packets at
all, so we would treat this as success!

So, instead, match the start of the packet, including the source and
destination addresses and the icmp type.  (This crude match will fail
if the reply contains any IP options, but the ping comes from the peer
secnet so it won't have.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
stest/common.tcl