path: root/tools
diff options
authorJason A. Donenfeld <Jason@zx2c4.com>2021-06-06 10:47:42 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-06-06 11:21:24 +0200
commita9da8abbfdf4151339a715d8f33d8a3c34fa5ee7 (patch)
tree8ab57b9f0df500496ec4c9e88711a021f7e8088c /tools
parentwireguard: selftests: increase default dmesg log size (diff)
wireguard: selftests: actually test for routing loopsHEADstable
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. Fixes: b673e24aad36 ("wireguard: socket: remove errant restriction on looping to self") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tools')
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/wireguard/netns.sh b/tools/testing/selftests/wireguard/netns.sh
index ebc4ee0fe179..b3dc6ed1f8f4 100755
--- a/tools/testing/selftests/wireguard/netns.sh
+++ b/tools/testing/selftests/wireguard/netns.sh
@@ -276,7 +276,11 @@ n0 ping -W 1 -c 1
n1 wg set wg0 peer "$pub2" endpoint
ip2 link del wg0
ip2 link del wg1
-! n0 ping -W 1 -c 10 -f || false # Should not crash kernel
+read _ _ tx_bytes_before < <(n0 wg show wg1 transfer)
+! n0 ping -W 1 -c 10 -f || false
+sleep 1
+read _ _ tx_bytes_after < <(n0 wg show wg1 transfer)
+(( tx_bytes_after - tx_bytes_before < 60000 ))
ip0 link del wg1
ip1 link del wg0