Index: sys/netinet/icmp6.h =================================================================== --- sys/netinet/icmp6.h +++ sys/netinet/icmp6.h @@ -704,8 +704,6 @@ void icmp6_error(struct mbuf *, int, int, int); void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *); int icmp6_input(struct mbuf **, int *, int); -void icmp6_fasttimo(void); -void icmp6_slowtimo(void); void icmp6_prepare(struct mbuf *); void icmp6_redirect_input(struct mbuf *, int); void icmp6_redirect_output(struct mbuf *, struct nhop_object *); Index: sys/netinet6/icmp6.c =================================================================== --- sys/netinet6/icmp6.c +++ sys/netinet6/icmp6.c @@ -2127,20 +2127,6 @@ return; } -void -icmp6_fasttimo(void) -{ - - mld_fasttimo(); -} - -void -icmp6_slowtimo(void) -{ - - mld_slowtimo(); -} - static const char * icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6, struct in6_addr *tgt6) Index: sys/netinet6/in6.c =================================================================== --- sys/netinet6/in6.c +++ sys/netinet6/in6.c @@ -79,7 +79,6 @@ #include #include #include -#include #include #include #include Index: sys/netinet6/in6_proto.c =================================================================== --- sys/netinet6/in6_proto.c +++ sys/netinet6/in6_proto.c @@ -211,8 +211,6 @@ .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_ctloutput = rip6_ctloutput, - .pr_fasttimo = icmp6_fasttimo, - .pr_slowtimo = icmp6_slowtimo, .pr_usrreqs = &rip6_usrreqs }, #ifdef INET Index: sys/netinet6/mld6.c =================================================================== --- sys/netinet6/mld6.c +++ sys/netinet6/mld6.c @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include @@ -1294,8 +1293,9 @@ * Fast timeout handler (global). * VIMAGE: Timeout handlers are expected to service all vimages. */ -void -mld_fasttimo(void) +static struct callout mldfast_callout; +static void +mld_fasttimo(void *arg __unused) { struct in6_multi_head inmh; VNET_ITERATOR_DECL(vnet_iter); @@ -1310,6 +1310,8 @@ } VNET_LIST_RUNLOCK_NOSLEEP(); in6m_release_list_deferred(&inmh); + + callout_reset(&mldfast_callout, hz / PR_FASTHZ, mld_fasttimo, NULL); } /* @@ -1707,8 +1709,9 @@ * Global slowtimo handler. * VIMAGE: Timeout handlers are expected to service all vimages. */ -void -mld_slowtimo(void) +static struct callout mldslow_callout; +static void +mld_slowtimo(void *arg __unused) { VNET_ITERATOR_DECL(vnet_iter); @@ -1719,6 +1722,8 @@ CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); + + callout_reset(&mldslow_callout, hz / PR_SLOWHZ, mld_slowtimo, NULL); } /* @@ -3268,6 +3273,11 @@ mld_po.ip6po_hbh = &mld_ra.hbh; mld_po.ip6po_prefer_tempaddr = IP6PO_TEMPADDR_NOTPREFER; mld_po.ip6po_flags = IP6PO_DONTFRAG; + + callout_init(&mldslow_callout, 1); + callout_reset(&mldslow_callout, hz / PR_SLOWHZ, mld_slowtimo, NULL); + callout_init(&mldfast_callout, 1); + callout_reset(&mldfast_callout, hz / PR_FASTHZ, mld_fasttimo, NULL); } SYSINIT(mld_init, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_init, NULL); @@ -3276,6 +3286,8 @@ { CTR1(KTR_MLD, "%s: tearing down", __func__); + callout_drain(&mldslow_callout); + callout_drain(&mldfast_callout); MLD_LOCK_DESTROY(); } SYSUNINIT(mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_uninit, NULL); Index: sys/netinet6/mld6_var.h =================================================================== --- sys/netinet6/mld6_var.h +++ sys/netinet6/mld6_var.h @@ -165,15 +165,16 @@ struct mld_ifsoftc * mld_domifattach(struct ifnet *); void mld_domifdetach(struct ifnet *); -void mld_fasttimo(void); void mld_ifdetach(struct ifnet *, struct in6_multi_head *); int mld_input(struct mbuf **, int, int); -void mld_slowtimo(void); #ifdef SYSCTL_DECL SYSCTL_DECL(_net_inet6_mld); #endif +#define PR_SLOWHZ 2 /* 2 slow timeouts per second */ +#define PR_FASTHZ 5 /* 5 fast timeouts per second */ + #endif /* _KERNEL */ #endif /* _NETINET6_MLD6_VAR_H_ */