Commit 7c8b89ec authored by Hangbin Liu's avatar Hangbin Liu Committed by Jakub Kicinski
Browse files

selftests: netfilter: remove rp_filter configuration



Remove the rp_filter configuration in netfilter lib, as setup_ns already
sets it appropriately by default

Acked-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250508081910.84216-6-liuhangbin@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3f68f59e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -60,9 +60,6 @@ bcast_ping()
	done
}

ip netns exec "$ns0" sysctl -q net.ipv4.conf.all.rp_filter=0
ip netns exec "$ns0" sysctl -q net.ipv4.conf.default.rp_filter=0

if ! ip link add veth1 netns "$ns0" type veth peer name eth0 netns "$ns1"; then
	echo "SKIP: Can't create veth device"
	exit $ksft_skip
+0 −2
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ trap cleanup EXIT

setup_ns nsbr ns1 ns2

ip netns exec "$nsbr" sysctl -q net.ipv4.conf.default.rp_filter=0
ip netns exec "$nsbr" sysctl -q net.ipv4.conf.all.rp_filter=0
if ! ip link add veth0 netns "$nsbr" type veth peer name eth0 netns "$ns1"; then
	echo "SKIP: Can't create veth device"
	exit $ksft_skip
+0 −3
Original line number Diff line number Diff line
@@ -52,9 +52,6 @@ trap cleanup EXIT

setup_ns ns0 ns1

ip netns exec "$ns0" sysctl -q -w net.ipv4.conf.default.rp_filter=0
ip netns exec "$ns0" sysctl -q -w net.ipv4.conf.all.rp_filter=0
ip netns exec "$ns0" sysctl -q -w net.ipv4.conf.all.rp_filter=0
ip netns exec "$ns0" sysctl -q -w net.ipv4.conf.all.forwarding=1

if ! ip link add veth0 netns "$ns0" type veth peer name veth0 netns "$ns1" > /dev/null 2>&1; then
+0 −6
Original line number Diff line number Diff line
@@ -129,9 +129,6 @@ test_dr() {
	# avoid incorrect arp response
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.arp_ignore=1
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.arp_announce=2
	# avoid reverse route lookup
	ip netns exec "${ns2}" sysctl -qw  net.ipv4.conf.all.rp_filter=0
	ip netns exec "${ns2}" sysctl -qw  net.ipv4.conf.veth21.rp_filter=0
	ip netns exec "${ns2}" ip addr add "${vip_v4}/32" dev lo:1

	test_service
@@ -167,9 +164,6 @@ test_tun() {
	ip netns exec "${ns2}" ip link set tunl0 up
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.arp_ignore=1
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.arp_announce=2
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.rp_filter=0
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.tunl0.rp_filter=0
	ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.veth21.rp_filter=0
	ip netns exec "${ns2}" ip addr add "${vip_v4}/32" dev lo:1

	test_service
+0 −2
Original line number Diff line number Diff line
@@ -167,8 +167,6 @@ test_ping() {
ip netns exec "$nsrouter" sysctl net.ipv6.conf.all.forwarding=1 > /dev/null
ip netns exec "$nsrouter" sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null
ip netns exec "$nsrouter" sysctl net.ipv4.conf.veth1.forwarding=1 > /dev/null
ip netns exec "$nsrouter" sysctl net.ipv4.conf.all.rp_filter=0 > /dev/null
ip netns exec "$nsrouter" sysctl net.ipv4.conf.veth0.rp_filter=0 > /dev/null

test_ping 10.0.2.1 dead:2::1 || exit 1
check_drops || exit 1
Loading