Commit c0f8fa21 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 9bbcdb07 d1abf388
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment