Skip to content

Commit 9badbe1

Browse files
committed
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>
1 parent 7725610 commit 9badbe1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tests/netns.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ n0 ping -W 1 -c 1 192.168.241.2
280280
n1 wg set wg0 peer "$pub2" endpoint 192.168.241.2:7
281281
ip2 link del wg0
282282
ip2 link del wg1
283-
! n0 ping -W 1 -c 10 -f 192.168.241.2 || false # Should not crash kernel
283+
read _ _ tx_bytes_before < <(n0 wg show wg1 transfer)
284+
! n0 ping -W 1 -c 10 -f 192.168.241.2 || false
285+
sleep 1
286+
read _ _ tx_bytes_after < <(n0 wg show wg1 transfer)
287+
(( tx_bytes_after - tx_bytes_before < 70000 ))
284288

285289
ip0 link del wg1
286290
ip1 link del wg0

0 commit comments

Comments
 (0)