Skip to content

Commit f84ab63

Browse files
Florian Westphalkuba-moo
authored andcommitted
selftests: netfilter: nft_flowtable.sh: re-run with random mtu sizes
Now that the test runs much faster, also re-run it with random MTU sizes for the different link legs. flowtable should pass ip fragments, if any, up to the normal forwarding path. Signed-off-by: Florian Westphal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c54fa6a commit f84ab63

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tools/testing/selftests/net/netfilter/nft_flowtable.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ if ! ip -net $nsr2 link set veth1 mtu $rmtu; then
100100
exit 1
101101
fi
102102

103+
if ! ip -net "$nsr1" link set veth1 mtu "$lmtu"; then
104+
exit 1
105+
fi
106+
107+
if ! ip -net "$nsr2" link set veth0 mtu "$lmtu"; then
108+
exit 1
109+
fi
110+
103111
ip -net $ns2 link set eth0 mtu $rmtu
104112

105113
# transfer-net between nsr1 and nsr2.
@@ -633,4 +641,15 @@ else
633641
ip netns exec "$nsr1" cat /proc/net/xfrm_stat 1>&2
634642
fi
635643

644+
if [ x"$1" = x ]; then
645+
low=1280
646+
mtu=$((65536 - low))
647+
o=$(((RANDOM%mtu) + low))
648+
l=$(((RANDOM%mtu) + low))
649+
r=$(((RANDOM%mtu) + low))
650+
651+
echo "re-run with random mtus: -o $o -l $l -r $r"
652+
$0 -o "$o" -l "$l" -r "$r"
653+
fi
654+
636655
exit $ret

0 commit comments

Comments
 (0)