diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-12-27 18:45:02 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-12-27 18:45:02 +0000 |
commit | 15d7c332367f067447fa7edb3f23b811f55bb7b0 (patch) | |
tree | c239694e1b02d5d2861fe44e2bc7d85cf8ea122f | |
parent | cf7292a0dbd4ea5938bb2067d6296a3b32a6065e (diff) |
Move nd6 timer initialisation to nd6_init() and call timeout_set()
only once during init.
OK mpi@
-rw-r--r-- | sys/netinet6/ip6_input.c | 14 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 8 | ||||
-rw-r--r-- | sys/netinet6/nd6.h | 5 |
3 files changed, 7 insertions, 20 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 4b57e07f6ad..f52ad6f2095 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.173 2016/12/26 21:30:10 jca Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.174 2016/12/27 18:45:01 bluhm Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -119,7 +119,6 @@ struct niqueue ip6intrq = NIQUEUE_INITIALIZER(IFQ_MAXLEN, NETISR_IPV6); struct ip6stat ip6stat; -void ip6_init2(void *); int ip6_check_rh0hdr(struct mbuf *, int *); int ip6_hbhchcheck(struct mbuf *, int *, int *, int *); @@ -157,21 +156,10 @@ ip6_init(void) ip6_randomid_init(); nd6_init(); frag6_init(); - ip6_init2(NULL); mq_init(&ip6send_mq, 64, IPL_SOFTNET); } -void -ip6_init2(void *dummy) -{ - - /* nd6_timer_init */ - bzero(&nd6_timer_ch, sizeof(nd6_timer_ch)); - timeout_set(&nd6_timer_ch, nd6_timer, NULL); - timeout_add_sec(&nd6_timer_ch, 1); -} - /* * IP6 input interrupt handling. Just pass the packet to ip6_input. */ diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 40e4bfc96c7..082e93021a4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.201 2016/12/23 15:08:54 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.202 2016/12/27 18:45:01 bluhm Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -93,6 +93,8 @@ struct nd_prhead nd_prefix = { 0 }; int nd6_recalc_reachtm_interval = ND6_RECALC_REACHTM_INTERVAL; void nd6_slowtimo(void *); +void nd6_timer_work(void *); +void nd6_timer(void *); void nd6_invalidate(struct rtentry *); struct llinfo_nd6 *nd6_free(struct rtentry *, int); void nd6_llinfo_timer(void *); @@ -100,7 +102,6 @@ void nd6_llinfo_timer(void *); struct timeout nd6_slowtimo_ch; struct timeout nd6_timer_ch; struct task nd6_timer_task; -void nd6_timer_work(void *); int fill_drlist(void *, size_t *, size_t); int fill_prlist(void *, size_t *, size_t); @@ -129,6 +130,8 @@ nd6_init(void) /* start timer */ timeout_set_proc(&nd6_slowtimo_ch, nd6_slowtimo, NULL); timeout_add_sec(&nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL); + timeout_set(&nd6_timer_ch, nd6_timer, NULL); + timeout_add_sec(&nd6_timer_ch, nd6_prune); nd6_rs_init(); } @@ -437,7 +440,6 @@ nd6_timer_work(void *null) NET_LOCK(s); - timeout_set(&nd6_timer_ch, nd6_timer, NULL); timeout_add_sec(&nd6_timer_ch, nd6_prune); /* expire default router list */ diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 03364d7b4ec..4274cd4dd07 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.h,v 1.65 2016/11/28 13:59:51 mpi Exp $ */ +/* $OpenBSD: nd6.h,v 1.66 2016/12/27 18:45:01 bluhm Exp $ */ /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ /* @@ -223,8 +223,6 @@ extern int nd6_debug; #define nd6log(x) do { if (nd6_debug) log x; } while (0) -extern struct timeout nd6_timer_ch; - union nd_opts { struct nd_opt_hdr *nd_opt_array[9]; struct { @@ -260,7 +258,6 @@ int nd6_options(union nd_opts *); struct rtentry *nd6_lookup(struct in6_addr *, int, struct ifnet *, u_int); void nd6_setmtu(struct ifnet *); void nd6_llinfo_settimer(struct llinfo_nd6 *, int); -void nd6_timer(void *); void nd6_purge(struct ifnet *); void nd6_nud_hint(struct rtentry *); void nd6_rtrequest(struct ifnet *, int, struct rtentry *); |