Skip to content

Commit

Permalink
selftests: cmsg_ipv6: repeat the exact packet
Browse files Browse the repository at this point in the history
cmsg_ipv6 test requests tcpdump to capture 4 packets,
and sends until tcpdump quits. Only the first packet
is "real", however, and the rest are basic UDP packets.
So if tcpdump doesn't start in time it will miss
the real packet and only capture the UDP ones.

This makes the test fail on slow machine (no KVM or with
debug enabled) 100% of the time, while it passes in fast
environments.

Repeat the "real" / expected packet.

Fixes: 9657ad0 ("selftests: net: test IPV6_TCLASS")
Fixes: 05ae83d ("selftests: net: test IPV6_HOPLIMIT")
Signed-off-by: Jakub Kicinski <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kuba-moo authored and davem330 committed Feb 7, 2024
1 parent 38cc3c6 commit 4b00d0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/net/cmsg_ipv6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ for ovr in setsock cmsg both diff; do
check_result $? 0 "TCLASS $prot $ovr - pass"

while [ -d /proc/$BG ]; do
$NSEXE ./cmsg_sender -6 -p u $TGT6 1234
$NSEXE ./cmsg_sender -6 -p $p $m $((TOS2)) $TGT6 1234
done

tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null
Expand Down Expand Up @@ -126,7 +126,7 @@ for ovr in setsock cmsg both diff; do
check_result $? 0 "HOPLIMIT $prot $ovr - pass"

while [ -d /proc/$BG ]; do
$NSEXE ./cmsg_sender -6 -p u $TGT6 1234
$NSEXE ./cmsg_sender -6 -p $p $m $LIM $TGT6 1234
done

tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null
Expand Down

0 comments on commit 4b00d0c

Please sign in to comment.