diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-11-29 13:43:07 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-12-03 23:24:03 +0100 |
commit | cb001d454024a01256fc269c64e364752a0e7c60 (patch) | |
tree | 458053f8dc6c613e69a07764e4036d53e5c3c3ec | |
parent | compat: update for RHEL 8.5 (diff) | |
download | wireguard-linux-compat-cb001d454024a01256fc269c64e364752a0e7c60.tar.xz wireguard-linux-compat-cb001d454024a01256fc269c64e364752a0e7c60.zip |
netns: actually test for routing loops
We previously removed the restriction on looping to self, and then added
a test to make sure the kernel didn't blow up during a routing loop. The
kernel didn't blow up, thankfully, but on certain architectures where
skb fragmentation is easier, such as ppc64, the skbs weren't actually
being discarded after a few rounds through. But the test wasn't catching
this. So actually test explicitly for massive increases in tx to see if
we have a routing loop. Note that the actual loop problem will need to
be addressed in a different commit.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rwxr-xr-x | src/tests/netns.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/netns.sh b/src/tests/netns.sh index 5fa01f1..39dde97 100755 --- a/src/tests/netns.sh +++ b/src/tests/netns.sh @@ -280,7 +280,11 @@ n0 ping -W 1 -c 1 192.168.241.2 n1 wg set wg0 peer "$pub2" endpoint 192.168.241.2:7 ip2 link del wg0 ip2 link del wg1 -! n0 ping -W 1 -c 10 -f 192.168.241.2 || false # Should not crash kernel +read _ _ tx_bytes_before < <(n0 wg show wg1 transfer) +! n0 ping -W 1 -c 10 -f 192.168.241.2 || false +sleep 1 +read _ _ tx_bytes_after < <(n0 wg show wg1 transfer) +(( tx_bytes_after - tx_bytes_before < 70000 )) ip0 link del wg1 ip1 link del wg0 |