diff options
authorDavid S. Miller <davem@davemloft.net>2019-05-20 20:20:20 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-20 20:20:20 -0400
commitc0f8fa21b3dc0c6595b56bfb3e69d75274b5a0ed (patch)
parenttipc: Avoid copying bytes beyond the supplied data (diff)
parentselftests: fib_rule_tests: enable forwarding before ipv4 from/iif test (diff)
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>
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 dev dummy0
+ $IP address add 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"