chiark / gitweb /
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>