/usr/src/linux-headers-5.15.0-181/tools/testing/selftests/net
NameSizeModeActions
af_unix/-0755rm
forwarding/-0755rm
mptcp/-0755rm
altnames.sh18170755editdlrm
bareudp.sh212900755editdlrm
drop_monitor_tests.sh44390755editdlrm
fcnal-test.sh1032210755editdlrm
fib-onlink-tests.sh124090755editdlrm
fib_nexthops.sh680030755editdlrm
fib_nexthop_multiprefix.sh58700755editdlrm
fib_nexthop_nongw.sh23270755editdlrm
fib_rule_tests.sh59810755editdlrm
fib_tests.sh572240755editdlrm
fin_ack_lat.sh5070755editdlrm
gre_gso.sh42370755editdlrm
gro.sh21320755editdlrm
icmp.sh26180755editdlrm
icmp_redirect.sh128200755editdlrm
in_netns.sh3230755editdlrm
ioam6.sh259620755editdlrm
ip6_gre_headroom.sh14000755editdlrm
ipv6_flowlabel.sh5020755editdlrm
ip_defrag.sh20870755editdlrm
l2tp.sh99090755editdlrm
lib.sh5970644editdlrm
Makefile24990644editdlrm
msg_zerocopy.sh30120755editdlrm
netdevice.sh45210755editdlrm
net_helper.sh5140644editdlrm
pmtu.sh747110755editdlrm
psock_snd.sh22520755editdlrm
reuseaddr_ports_exhausted.sh6350755editdlrm
reuseport_addr_any.sh810755editdlrm
route_localnet.sh18710755editdlrm
rtnetlink.sh294760755editdlrm
rxtimestamp.sh790755editdlrm
setup_loopback.sh26540644editdlrm
setup_veth.sh9290644editdlrm
so_txtime.sh24340755editdlrm
srv6_end_dt4_l3vpn_test.sh174540755editdlrm
srv6_end_dt6_l3vpn_test.sh176150755editdlrm
srv6_end_dt46_l3vpn_test.sh211210755editdlrm
tcp_fastopen_backup_key.sh10860755editdlrm
test_blackhole_dev.sh2800755editdlrm
test_bpf.sh2250755editdlrm
test_vxlan_fdb_changelink.sh6780755editdlrm
test_vxlan_under_vrf.sh56070755editdlrm
toeplitz.sh49830755editdlrm
toeplitz_client.sh6670755editdlrm
traceroute.sh71310755editdlrm
txtimestamp.sh17020755editdlrm
udpgro.sh59880755editdlrm
udpgro_bench.sh21260755editdlrm
udpgro_fwd.sh71450755editdlrm
udpgso.sh5450755editdlrm
udpgso_bench.sh28520755editdlrm
unicast_extensions.sh82630755editdlrm
veth.sh104410755editdlrm
vrf-xfrm-tests.sh109700755editdlrm
vrf_route_leaking.sh149460755editdlrm
vrf_strict_mode_test.sh76880755editdlrm
xfrm_policy.sh147590755editdlrm
Edit: /usr/src/linux-headers-5.15.0-181/tools/testing/selftests/net/icmp.sh (2618B)
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Test for checking ICMP response with dummy address instead of 0.0.0.0. # Sets up two namespaces like: # +----------------------+ +--------------------+ # | ns1 | v4-via-v6 routes: | ns2 | # | | ' | | # | +--------+ -> 172.16.1.0/24 -> +--------+ | # | | veth0 +--------------------------+ veth0 | | # | +--------+ <- 172.16.0.0/24 <- +--------+ | # | 172.16.0.1 | | 2001:db8:1::2/64 | # | 2001:db8:1::2/64 | | | # +----------------------+ +--------------------+ # # And then tries to ping 172.16.1.1 from ns1. This results in a "net # unreachable" message being sent from ns2, but there is no IPv4 address set in # that address space, so the kernel should substitute the dummy address # 192.0.0.8 defined in RFC7600. NS1=ns1 NS2=ns2 H1_IP=172.16.0.1/32 H1_IP6=2001:db8:1::1 RT1=172.16.1.0/24 PINGADDR=172.16.1.1 RT2=172.16.0.0/24 H2_IP6=2001:db8:1::2 TMPFILE=$(mktemp) cleanup() { rm -f "$TMPFILE" ip netns del $NS1 ip netns del $NS2 } trap cleanup EXIT # Namespaces ip netns add $NS1 ip netns add $NS2 # Connectivity ip -netns $NS1 link add veth0 type veth peer name veth0 netns $NS2 ip -netns $NS1 link set dev veth0 up ip -netns $NS2 link set dev veth0 up ip -netns $NS1 addr add $H1_IP dev veth0 ip -netns $NS1 addr add $H1_IP6/64 dev veth0 nodad ip -netns $NS2 addr add $H2_IP6/64 dev veth0 nodad ip -netns $NS1 route add $RT1 via inet6 $H2_IP6 ip -netns $NS2 route add $RT2 via inet6 $H1_IP6 # Make sure ns2 will respond with ICMP unreachable ip netns exec $NS2 sysctl -qw net.ipv4.icmp_ratelimit=0 net.ipv4.ip_forward=1 # Run the test - a ping runs in the background, and we capture ICMP responses # with tcpdump; -c 1 means it should exit on the first ping, but add a timeout # in case something goes wrong ip netns exec $NS1 ping -w 3 -i 0.5 $PINGADDR >/dev/null & ip netns exec $NS1 timeout 10 tcpdump -tpni veth0 -c 1 'icmp and icmp[icmptype] != icmp-echo' > $TMPFILE 2>/dev/null # Parse response and check for dummy address # tcpdump output looks like: # IP 192.0.0.8 > 172.16.0.1: ICMP net 172.16.1.1 unreachable, length 92 RESP_IP=$(awk '{print $2}' < $TMPFILE) if [[ "$RESP_IP" != "192.0.0.8" ]]; then echo "FAIL - got ICMP response from $RESP_IP, should be 192.0.0.8" exit 1 else echo "OK" exit 0 fi