Commit d1abf388 authored by Hangbin Liu's avatar Hangbin Liu Committed by David S. Miller
Browse files

selftests: fib_rule_tests: enable forwarding before ipv4 from/iif test



As all the testing addresses are in the same subnet and egress device ==
ingress device. We need enable forwarding to get the route entry.

Also disable rp_filer separately as some distributions enable it in
startup scripts.

Fixes: 65b2b493 ("selftests: net: initial fib rule tests")
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc82d93e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -186,8 +186,13 @@ fib_rule4_test()
	match="oif $DEV"
	fib_rule4_test_match_n_redirect "$match" "$match" "oif redirect to table"

	# need enable forwarding and disable rp_filter temporarily as all the
	# addresses are in the same subnet and egress device == ingress device.
	ip netns exec testns sysctl -w net.ipv4.ip_forward=1
	ip netns exec testns sysctl -w net.ipv4.conf.$DEV.rp_filter=0
	match="from $SRC_IP iif $DEV"
	fib_rule4_test_match_n_redirect "$match" "$match" "iif redirect to table"
	ip netns exec testns sysctl -w net.ipv4.ip_forward=0

	match="tos 0x10"
	fib_rule4_test_match_n_redirect "$match" "$match" "tos redirect to table"