diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-05-04 16:52:11 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-05-04 16:52:11 +0000 |
commit | 120d015e5cf746cb287c317fa45a45c2853e77d3 (patch) | |
tree | 1fa68e42a384d05772de04d70da93ab18ea4c9a4 /sys/netinet6 | |
parent | 16cf6a07a000ecc0be80289390c64394200691fc (diff) |
Move rttimer callback function from the rttimer itself to rttimer_queue.
All users use the same callback per queue so that makes sense.
Also replace rt_timer_queue_destroy() with rt_timer_queue_flush().
OK bluhm@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 13 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 5 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 7 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.h | 3 |
4 files changed, 15 insertions, 13 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 7ea31f0b4de..30ea817a921 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.240 2022/04/30 07:20:35 claudio Exp $ */ +/* $OpenBSD: icmp6.c,v 1.241 2022/05/04 16:52:10 claudio Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -143,8 +143,10 @@ void icmp6_init(void) { mld6_init(); - icmp6_mtudisc_timeout_q = rt_timer_queue_create(ip6_mtudisc_timeout); - icmp6_redirect_timeout_q = rt_timer_queue_create(icmp6_redirtimeout); + icmp6_mtudisc_timeout_q = rt_timer_queue_create(ip6_mtudisc_timeout, + &icmp6_mtudisc_timeout); + icmp6_redirect_timeout_q = rt_timer_queue_create(icmp6_redirtimeout, + NULL); icmp6counters = counters_alloc(icp6s_ncounters); } @@ -1404,7 +1406,7 @@ icmp6_redirect_input(struct mbuf *m, int off) rtredirect(sin6tosa(&sdst), sin6tosa(&sgw), sin6tosa(&ssrc), &newrt, m->m_pkthdr.ph_rtableid); if (newrt != NULL && icmp6_redirtimeout > 0) { - rt_timer_add(newrt, NULL, icmp6_redirect_timeout_q, + rt_timer_add(newrt, icmp6_redirect_timeout_q, m->m_pkthdr.ph_rtableid); } rtfree(newrt); @@ -1828,8 +1830,7 @@ icmp6_mtudisc_clone(struct sockaddr_in6 *dst, u_int rtableid, int ipsec) rt = nrt; rtm_send(rt, RTM_ADD, 0, rtableid); } - error = rt_timer_add(rt, icmp6_mtudisc_timeout, icmp6_mtudisc_timeout_q, - rtableid); + error = rt_timer_add(rt, icmp6_mtudisc_timeout_q, rtableid); if (error) goto bad; diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 6230f03f895..937ef1a9c44 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.243 2022/04/28 17:27:14 claudio Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.244 2022/05/04 16:52:10 claudio Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -162,7 +162,8 @@ ip6_init(void) ip6counters = counters_alloc(ip6s_ncounters); #ifdef MROUTING - ip6_mrouterq = rt_timer_queue_create(MCAST_EXPIRE_TIMEOUT); + ip6_mrouterq = rt_timer_queue_create(MCAST_EXPIRE_TIMEOUT, + &mf6c_expire_route); #endif } diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 504b2082bb9..28c7c04cb8f 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.c,v 1.129 2022/04/30 07:20:35 claudio Exp $ */ +/* $OpenBSD: ip6_mroute.c,v 1.130 2022/05/04 16:52:10 claudio Exp $ */ /* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */ /* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */ @@ -176,7 +176,6 @@ struct rtentry *mf6c_find(struct ifnet *, struct in6_addr *, struct rtentry *mrt6_mcast_add(struct ifnet *, struct sockaddr *, struct sockaddr *); void mrt6_mcast_del(struct rtentry *, unsigned int); -void mf6c_expire_route(struct rtentry *, u_int); /* * Handle MRT setsockopt commands to modify the multicast routing tables. @@ -677,7 +676,7 @@ mf6c_add_route(struct ifnet *ifp, struct sockaddr *origin, } rt->rt_llinfo = (caddr_t)mf6c; - rt_timer_add(rt, mf6c_expire_route, ip6_mrouterq, rtableid); + rt_timer_add(rt, ip6_mrouterq, rtableid); mf6c->mf6c_parent = mf6cc->mf6cc_parent; rtfree(rt); @@ -1004,7 +1003,7 @@ mf6c_expire_route(struct rtentry *rt, u_int rtableid) if (mf6c->mf6c_expire == 0) { mf6c->mf6c_expire = 1; - rt_timer_add(rt, mf6c_expire_route, ip6_mrouterq, rtableid); + rt_timer_add(rt, ip6_mrouterq, rtableid); return; } diff --git a/sys/netinet6/ip6_mroute.h b/sys/netinet6/ip6_mroute.h index b63e968f370..f7d3e6cdcb7 100644 --- a/sys/netinet6/ip6_mroute.h +++ b/sys/netinet6/ip6_mroute.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.h,v 1.21 2022/04/28 17:27:14 claudio Exp $ */ +/* $OpenBSD: ip6_mroute.h,v 1.22 2022/05/04 16:52:10 claudio Exp $ */ /* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ /* @@ -195,6 +195,7 @@ struct sioc_mif_req6 { #define MCAST_EXPIRE_TIMEOUT 30 extern struct rttimer_queue *ip6_mrouterq; +void mf6c_expire_route(struct rtentry *, u_int); /* * The kernel's multicast-interface structure. |