]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: remove redundant rp_filter configuration
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 8 May 2025 08:19:06 +0000 (08:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 May 2025 01:10:55 +0000 (18:10 -0700)
The following tests use setup_ns to create a network namespace, which
will disables rp_filter immediately after namespace creation. Therefore,
it is no longer necessary to disable rp_filter again within these individual
tests.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250508081910.84216-3-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/fib_rule_tests.sh
tools/testing/selftests/net/fib_tests.sh
tools/testing/selftests/net/icmp_redirect.sh

index c7cea556b4169407d54cd6781670bcfc060b0ddc..5fbdd2a0b537544bdda8ee23b39f6ebce25eeb9d 100755 (executable)
@@ -516,10 +516,7 @@ fib_rule4_test()
        fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \
                "oif redirect to table" "oif no redirect to table"
 
-       # Enable forwarding and disable rp_filter as all the addresses are in
-       # the same subnet and egress device == ingress device.
        ip netns exec $testns sysctl -qw net.ipv4.ip_forward=1
-       ip netns exec $testns sysctl -qw net.ipv4.conf.$DEV.rp_filter=0
        match="from $SRC_IP iif $DEV"
        getnomatch="from $SRC_IP iif lo"
        fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \
index c58dc4ac2810c36fff7ad8aeacf164fd42bfb198..a94b73a53f72e5ff89ca17ed73297591e5d4ba17 100755 (executable)
@@ -2560,9 +2560,6 @@ ipv4_mpath_list_test()
        run_cmd "ip -n $ns2 route add 203.0.113.0/24
                nexthop via 172.16.201.2 nexthop via 172.16.202.2"
        run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.fib_multipath_hash_policy=1"
-       run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.veth2.rp_filter=0"
-       run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.all.rp_filter=0"
-       run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.default.rp_filter=0"
        set +e
 
        local dmac=$(ip -n $ns2 -j link show dev veth2 | jq -r '.[]["address"]')
index d6f0e449c0292ddb47daa8eba371f38899540041..b13c89a99ecbaa37638c39b12818d2d59a97ec50 100755 (executable)
@@ -178,8 +178,6 @@ setup()
                else
                        ip netns exec $ns sysctl -q -w net.ipv4.ip_forward=1
                        ip netns exec $ns sysctl -q -w net.ipv4.conf.all.send_redirects=1
-                       ip netns exec $ns sysctl -q -w net.ipv4.conf.default.rp_filter=0
-                       ip netns exec $ns sysctl -q -w net.ipv4.conf.all.rp_filter=0
 
                        ip netns exec $ns sysctl -q -w net.ipv6.conf.all.forwarding=1
                        ip netns exec $ns sysctl -q -w net.ipv6.route.mtu_expires=10