/
usr
/
src
/
linux-headers-5.15.0-190
/
tools
/
testing
/
selftests
/
net
/
/usr/src/linux-headers-5.15.0-190/tools/testing/selftests/net
mkdir
upload
Name
Size
Mode
Actions
af_unix/
-
0755
rm
forwarding/
-
0755
rm
mptcp/
-
0755
rm
altnames.sh
1817
0755
edit
dl
rm
bareudp.sh
21290
0755
edit
dl
rm
drop_monitor_tests.sh
4439
0755
edit
dl
rm
fcnal-test.sh
103221
0755
edit
dl
rm
fib-onlink-tests.sh
12409
0755
edit
dl
rm
fib_nexthops.sh
68003
0755
edit
dl
rm
fib_nexthop_multiprefix.sh
5870
0755
edit
dl
rm
fib_nexthop_nongw.sh
2327
0755
edit
dl
rm
fib_rule_tests.sh
5981
0755
edit
dl
rm
fib_tests.sh
57224
0755
edit
dl
rm
fin_ack_lat.sh
507
0755
edit
dl
rm
gre_gso.sh
4237
0755
edit
dl
rm
gro.sh
2132
0755
edit
dl
rm
icmp.sh
2618
0755
edit
dl
rm
icmp_redirect.sh
12820
0755
edit
dl
rm
in_netns.sh
323
0755
edit
dl
rm
ioam6.sh
25962
0755
edit
dl
rm
ip6_gre_headroom.sh
1400
0755
edit
dl
rm
ipv6_flowlabel.sh
502
0755
edit
dl
rm
ip_defrag.sh
2087
0755
edit
dl
rm
l2tp.sh
9909
0755
edit
dl
rm
lib.sh
597
0644
edit
dl
rm
Makefile
2499
0644
edit
dl
rm
msg_zerocopy.sh
3012
0755
edit
dl
rm
netdevice.sh
4521
0755
edit
dl
rm
net_helper.sh
514
0644
edit
dl
rm
pmtu.sh
74711
0755
edit
dl
rm
psock_snd.sh
2252
0755
edit
dl
rm
reuseaddr_ports_exhausted.sh
635
0755
edit
dl
rm
reuseport_addr_any.sh
81
0755
edit
dl
rm
route_localnet.sh
1871
0755
edit
dl
rm
rtnetlink.sh
29476
0755
edit
dl
rm
rxtimestamp.sh
79
0755
edit
dl
rm
setup_loopback.sh
2654
0644
edit
dl
rm
setup_veth.sh
929
0644
edit
dl
rm
so_txtime.sh
2434
0755
edit
dl
rm
srv6_end_dt4_l3vpn_test.sh
17454
0755
edit
dl
rm
srv6_end_dt6_l3vpn_test.sh
17615
0755
edit
dl
rm
srv6_end_dt46_l3vpn_test.sh
21121
0755
edit
dl
rm
tcp_fastopen_backup_key.sh
1086
0755
edit
dl
rm
test_blackhole_dev.sh
280
0755
edit
dl
rm
test_bpf.sh
225
0755
edit
dl
rm
test_vxlan_fdb_changelink.sh
678
0755
edit
dl
rm
test_vxlan_under_vrf.sh
5607
0755
edit
dl
rm
toeplitz.sh
4983
0755
edit
dl
rm
toeplitz_client.sh
667
0755
edit
dl
rm
traceroute.sh
7131
0755
edit
dl
rm
txtimestamp.sh
1702
0755
edit
dl
rm
udpgro.sh
5988
0755
edit
dl
rm
udpgro_bench.sh
2126
0755
edit
dl
rm
udpgro_fwd.sh
7145
0755
edit
dl
rm
udpgso.sh
545
0755
edit
dl
rm
udpgso_bench.sh
2852
0755
edit
dl
rm
unicast_extensions.sh
8263
0755
edit
dl
rm
veth.sh
10441
0755
edit
dl
rm
vrf-xfrm-tests.sh
10970
0755
edit
dl
rm
vrf_route_leaking.sh
14946
0755
edit
dl
rm
vrf_strict_mode_test.sh
7688
0755
edit
dl
rm
xfrm_policy.sh
14759
0755
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-190/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
Save
cmd:
run