net/ipv6: Revert attempt to simplify route replace and append

NetworkManager likes to manage linklocal prefix routes and does so with
the NLM_F_APPEND flag, breaking attempts to simplify the IPv6 route
code and by extension enable multipath routes with device only nexthops.

Revert f34436a430 and these followup patches:
6eba08c362 ("ipv6: Only emit append events for appended routes").
ce45bded64 ("mlxsw: spectrum_router: Align with new route replace logic")
53b562df8c ("mlxsw: spectrum_router: Allow appending to dev-only routes")

Update the fib_tests cases to reflect the old behavior.

Fixes: f34436a430 ("net/ipv6: Simplify route replace and appending into multipath route")
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern
2018-07-03 14:36:21 -07:00
committed by David S. Miller
parent d5a672ac9f
commit 33bd5ac54d
5 changed files with 120 additions and 140 deletions

View File

@@ -740,13 +740,6 @@ ipv6_rt_add()
run_cmd "$IP -6 ro add unreachable 2001:db8:104::/64"
log_test $? 2 "Attempt to add duplicate route - reject route"
# iproute2 prepend only sets NLM_F_CREATE
# - adds a new route; does NOT convert existing route to ECMP
add_route6 "2001:db8:104::/64" "via 2001:db8:101::2"
run_cmd "$IP -6 ro prepend 2001:db8:104::/64 via 2001:db8:103::2"
check_route6 "2001:db8:104::/64 via 2001:db8:101::2 dev veth1 metric 1024 2001:db8:104::/64 via 2001:db8:103::2 dev veth3 metric 1024"
log_test $? 0 "Add new route for existing prefix (w/o NLM_F_EXCL)"
# route append with same prefix adds a new route
# - iproute2 sets NLM_F_CREATE | NLM_F_APPEND
add_route6 "2001:db8:104::/64" "via 2001:db8:101::2"
@@ -754,27 +747,6 @@ ipv6_rt_add()
check_route6 "2001:db8:104::/64 metric 1024 nexthop via 2001:db8:101::2 dev veth1 weight 1 nexthop via 2001:db8:103::2 dev veth3 weight 1"
log_test $? 0 "Append nexthop to existing route - gw"
add_route6 "2001:db8:104::/64" "via 2001:db8:101::2"
run_cmd "$IP -6 ro append 2001:db8:104::/64 dev veth3"
check_route6 "2001:db8:104::/64 metric 1024 nexthop via 2001:db8:101::2 dev veth1 weight 1 nexthop dev veth3 weight 1"
log_test $? 0 "Append nexthop to existing route - dev only"
# multipath route can not have a nexthop that is a reject route
add_route6 "2001:db8:104::/64" "via 2001:db8:101::2"
run_cmd "$IP -6 ro append unreachable 2001:db8:104::/64"
log_test $? 2 "Append nexthop to existing route - reject route"
# reject route can not be converted to multipath route
run_cmd "$IP -6 ro flush 2001:db8:104::/64"
run_cmd "$IP -6 ro add unreachable 2001:db8:104::/64"
run_cmd "$IP -6 ro append 2001:db8:104::/64 via 2001:db8:103::2"
log_test $? 2 "Append nexthop to existing reject route - gw"
run_cmd "$IP -6 ro flush 2001:db8:104::/64"
run_cmd "$IP -6 ro add unreachable 2001:db8:104::/64"
run_cmd "$IP -6 ro append 2001:db8:104::/64 dev veth3"
log_test $? 2 "Append nexthop to existing reject route - dev only"
# insert mpath directly
add_route6 "2001:db8:104::/64" "nexthop via 2001:db8:101::2 nexthop via 2001:db8:103::2"
check_route6 "2001:db8:104::/64 metric 1024 nexthop via 2001:db8:101::2 dev veth1 weight 1 nexthop via 2001:db8:103::2 dev veth3 weight 1"
@@ -819,13 +791,6 @@ ipv6_rt_replace_single()
check_route6 "2001:db8:104::/64 metric 1024 nexthop via 2001:db8:101::3 dev veth1 weight 1 nexthop via 2001:db8:103::2 dev veth3 weight 1"
log_test $? 0 "Single path with multipath"
# single path with reject
#
add_initial_route6 "nexthop via 2001:db8:101::2"
run_cmd "$IP -6 ro replace unreachable 2001:db8:104::/64"
check_route6 "unreachable 2001:db8:104::/64 dev lo metric 1024"
log_test $? 0 "Single path with reject route"
# single path with single path using MULTIPATH attribute
#
add_initial_route6 "via 2001:db8:101::2"
@@ -873,12 +838,6 @@ ipv6_rt_replace_mpath()
check_route6 "2001:db8:104::/64 via 2001:db8:101::3 dev veth1 metric 1024"
log_test $? 0 "Multipath with single path via multipath attribute"
# multipath with reject
add_initial_route6 "nexthop via 2001:db8:101::2 nexthop via 2001:db8:103::2"
run_cmd "$IP -6 ro replace unreachable 2001:db8:104::/64"
check_route6 "unreachable 2001:db8:104::/64 dev lo metric 1024"
log_test $? 0 "Multipath with reject route"
# route replace fails - invalid nexthop 1
add_initial_route6 "nexthop via 2001:db8:101::2 nexthop via 2001:db8:103::2"
run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:111::3 nexthop via 2001:db8:103::3"