summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2019-05-20 12:36:55 +0800
committerDavid S. Miller <davem@davemloft.net>2019-05-20 20:20:20 -0400
commitd1abf388604fffd0386ba0e4204d84451a7de9c2 (patch)
tree2f06454887b2efac0bb7e793128c821841d2eebb /tools
parentfc82d93e57e3d41f79eff19031588b262fc3d0b6 (diff)
downloadlinux-d1abf388604fffd0386ba0e4204d84451a7de9c2.tar.gz
linux-d1abf388604fffd0386ba0e4204d84451a7de9c2.tar.bz2
linux-d1abf388604fffd0386ba0e4204d84451a7de9c2.zip
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: 65b2b4939a64 ("selftests: net: initial fib rule tests") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/fib_rule_tests.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh
index 1ba069967fa2..617321d3b801 100755
--- a/tools/testing/selftests/net/fib_rule_tests.sh
+++ b/tools/testing/selftests/net/fib_rule_tests.sh
@@ -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"