Skip to content

Commit 5677669

Browse files
committed
selftests: net: add test case for NAT46 looping back dst
Simple test for crash involving multicast loopback and stale dst. Reuse exising NAT46 program. Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ba9db6f commit 5677669

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tools/testing/selftests/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ TEST_PROGS += amt.sh
2727
TEST_PROGS += unicast_extensions.sh
2828
TEST_PROGS += udpgro_fwd.sh
2929
TEST_PROGS += udpgro_frglist.sh
30+
TEST_PROGS += nat6to4.sh
3031
TEST_PROGS += veth.sh
3132
TEST_PROGS += ioam6.sh
3233
TEST_PROGS += gro.sh
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
4+
NS="ns-peer-$(mktemp -u XXXXXX)"
5+
6+
ip netns add "${NS}"
7+
ip -netns "${NS}" link set lo up
8+
ip -netns "${NS}" route add default via 127.0.0.2 dev lo
9+
10+
tc -n "${NS}" qdisc add dev lo ingress
11+
tc -n "${NS}" filter add dev lo ingress prio 4 protocol ip \
12+
bpf object-file nat6to4.bpf.o section schedcls/egress4/snat4 direct-action
13+
14+
ip netns exec "${NS}" \
15+
bash -c 'echo 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789abc | socat - UDP4-DATAGRAM:224.1.0.1:6666,ip-multicast-loop=1'

0 commit comments

Comments
 (0)