ipv6: Allow routes to use nexthop objects
authorDavid Ahern <dsahern@gmail.com>
Sat, 8 Jun 2019 21:53:34 +0000 (14:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Jun 2019 17:44:57 +0000 (10:44 -0700)
commit5b98324ebe29f4494b0fc45bde2d47ee716518fd
tree2e1bca429dcd237fbb858a42e5b5382eaf9f3bd3
parent6c48ea5fe639ab7e7b3eb5d8e8b324b13188bf10
ipv6: Allow routes to use nexthop objects

Add support for RTA_NH_ID attribute to allow a user to specify a
nexthop id to use with a route. fc_nh_id is added to fib6_config to
hold the value passed in the RTA_NH_ID attribute. If a nexthop id
is given, the gateway, device, encap and multipath attributes can
not be set.

Update ip6_route_del to check metric and protocol before nexthop
specs. If fc_nh_id is set, then it must match the id in the route
entry. Since IPv6 allows delete of a cached entry (an exception),
add ip6_del_cached_rt_nh to cycle through all of the fib6_nh in
a fib entry if it is using a nexthop.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip6_fib.h
net/ipv6/route.c