diff options
author | David S. Miller <davem@davemloft.net> | 2019-05-21 03:20:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-21 03:20:20 +0300 |
commit | c0f8fa21b3dc0c6595b56bfb3e69d75274b5a0ed (patch) | |
tree | 2f06454887b2efac0bb7e793128c821841d2eebb | |
parent | 9bbcdb07a53549ed072f03a88a5012e939a64c01 (diff) | |
parent | d1abf388604fffd0386ba0e4204d84451a7de9c2 (diff) | |
download | linux-c0f8fa21b3dc0c6595b56bfb3e69d75274b5a0ed.tar.xz |
Merge branch 'kselftests-fib_rule_tests-fix'
Hangbin Liu says:
====================
kselftests: fib_rule_tests: fix "from $SRC_IP iif $DEV" match testing
As all the IPv4 testing addresses are in the same subnet and egress device ==
ingress device, to pass "from $SRC_IP iif $DEV" match test, we need enable
forwarding to get the route entry.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-x | tools/testing/selftests/net/fib_rule_tests.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index 4b7e107865bf..617321d3b801 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -55,7 +55,7 @@ setup() $IP link add dummy0 type dummy $IP link set dev dummy0 up - $IP address add 198.51.100.1/24 dev dummy0 + $IP address add 192.51.100.1/24 dev dummy0 $IP -6 address add 2001:db8:1::1/64 dev dummy0 set +e @@ -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" |