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>
Sat, 7 Dec 2019 17:08:50 +0000 (17:08 +0000)
commit99555bcc9deefa4ec185459e4b137b36c5803a06
treec4133bb5fe24f65696014551dd2e5ff9520ec6ee
parentc7264471937381f2f824aaf114d38495b3dc7dfe
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