X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/593a1d5fd87cdf5b46dd5fcb84467b432cea0f91..c910b4d9d2451126ae3917b931cd4390c11e1d52:/bsd/netinet6/in6_rmx.c diff --git a/bsd/netinet6/in6_rmx.c b/bsd/netinet6/in6_rmx.c index fdaf9143f..178dd14d1 100644 --- a/bsd/netinet6/in6_rmx.c +++ b/bsd/netinet6/in6_rmx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * Copyright (c) 2003-2008 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -133,6 +133,9 @@ static void in6_rtqtimo(void *rock); static void in6_mtutimo(void *rock); extern int tvtohz(struct timeval *); +static struct radix_node *in6_matroute_args(void *, struct radix_node_head *, + rn_matchf_t *, void *); + #define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ /* @@ -236,15 +239,25 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, return ret; } +/* + * Similar to in6_matroute_args except without the leaf-matching parameters. + */ +static struct radix_node * +in6_matroute(void *v_arg, struct radix_node_head *head) +{ + return (in6_matroute_args(v_arg, head, NULL, NULL)); +} + /* * This code is the inverse of in6_clsroute: on first reference, if we * were managing the route, stop doing so and set the expiration timer * back off again. */ static struct radix_node * -in6_matroute(void *v_arg, struct radix_node_head *head) +in6_matroute_args(void *v_arg, struct radix_node_head *head, + rn_matchf_t *f, void *w) { - struct radix_node *rn = rn_match(v_arg, head); + struct radix_node *rn = rn_match_args(v_arg, head, f, w); struct rtentry *rt = (struct rtentry *)rn; if (rt && rt->rt_refcnt == 0) { /* this is first reference */ @@ -253,7 +266,7 @@ in6_matroute(void *v_arg, struct radix_node_head *head) rt->rt_rmx.rmx_expire = 0; } } - return rn; + return (rn); } SYSCTL_DECL(_net_inet6_ip6); @@ -527,6 +540,7 @@ in6_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in6_addroute; rnh->rnh_matchaddr = in6_matroute; + rnh->rnh_matchaddr_args = in6_matroute_args; rnh->rnh_close = in6_clsroute; in6_rtqtimo(rnh); /* kick off timeout first time */ in6_mtutimo(rnh); /* kick off timeout first time */