diff options
author | melifaro <melifaro@FreeBSD.org> | 2015-11-30 05:51:14 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2015-11-30 05:51:14 +0000 |
commit | e1984564835422629dc73f3551f3be70602c551a (patch) | |
tree | 0be60b29fa72a36767c89b7639430ba4896bcf2a /sys/netinet6/nd6_rtr.c | |
parent | 48efdd4beccfc6adef1e3c7e8cb51a875a76a814 (diff) | |
download | FreeBSD-src-e1984564835422629dc73f3551f3be70602c551a.zip FreeBSD-src-e1984564835422629dc73f3551f3be70602c551a.tar.gz |
Add new rt_foreach_fib_walk_del() function for deleting route entries
by filter function instead of picking into routing table details in
each consumer.
Remove now-unused rt_expunge() (eliminating last external RTF_RNH_LOCKED
user).
This simplifies future nexthops/mulitipath changes and rtrequest1_fib()
locking refactoring.
Actual changes:
Add "rt_chain" field to permit rte grouping while doing batched delete
from routing table (thus growing rte 200->208 on amd64).
Add "rti_filter" / "rti_filterdata" / "rti_spare" fields to rt_addrinfo
to pass filter function to various routing subsystems in standard way.
Convert all rt_expunge() customers to new rt_addinfo-based api and eliminate
rt_expunge().
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index cbcca46..b57cf15 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -88,7 +88,7 @@ static void in6_init_address_ltimes(struct nd_prefix *, static int nd6_prefix_onlink(struct nd_prefix *); static int nd6_prefix_offlink(struct nd_prefix *); -static int rt6_deleteroute(struct rtentry *, void *); +static int rt6_deleteroute(const struct rtentry *, void *); VNET_DECLARE(int, nd6_recalc_reachtm_interval); #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) @@ -2073,11 +2073,11 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) return; /* XXX Do we really need to walk any but the default FIB? */ - rt_foreach_fib_walk(AF_INET6, NULL, rt6_deleteroute, (void *)gateway); + rt_foreach_fib_walk_del(AF_INET6, rt6_deleteroute, (void *)gateway); } static int -rt6_deleteroute(struct rtentry *rt, void *arg) +rt6_deleteroute(const struct rtentry *rt, void *arg) { #define SIN6(s) ((struct sockaddr_in6 *)s) struct in6_addr *gate = (struct in6_addr *)arg; @@ -2104,8 +2104,7 @@ rt6_deleteroute(struct rtentry *rt, void *arg) if ((rt->rt_flags & RTF_HOST) == 0) return (0); - return (in6_rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), rt->rt_flags | RTF_RNH_LOCKED, NULL, rt->rt_fibnum)); + return (1); #undef SIN6 } |