No need to to this at runtime if the compiler can do it for us.
Also makes it easier to know what's going on at a glance, imho.
Feedback? OK?
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index c8720fb275c..035e65874ea 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -84,7 +84,8 @@ int nd6_debug = 1;
int nd6_debug = 0;
#endif
-TAILQ_HEAD(llinfo_nd6_head, llinfo_nd6) nd6_list;
+TAILQ_HEAD(llinfo_nd6_head, llinfo_nd6) nd6_list =
+ TAILQ_HEAD_INITIALIZER(nd6_list);
struct pool nd6_pool; /* pool for llinfo_nd6 structures */
int nd6_inuse;
@@ -96,10 +97,13 @@ void nd6_invalidate(struct rtentry *);
void nd6_free(struct rtentry *);
int nd6_llinfo_timer(struct rtentry *);
-struct timeout nd6_timer_to;
-struct timeout nd6_slowtimo_ch;
-struct timeout nd6_expire_timeout;
-struct task nd6_expire_task;
+struct timeout nd6_timer_to = TIMEOUT_INITIALIZER_FLAGS(nd6_timer, NULL,
+ TIMEOUT_PROC);
+struct timeout nd6_slowtimo_ch = TIMEOUT_INITIALIZER_FLAGS(nd6_slowtimo, NULL,
+ TIMEOUT_PROC);
+struct timeout nd6_expire_timeout = TIMEOUT_INITIALIZER(nd6_slowtimo, NULL);
+
+struct task nd6_expire_task = TASK_INITIALIZER(nd6_expire, NULL);
void
nd6_init(void)
@@ -111,19 +115,13 @@ nd6_init(void)
return;
}
- TAILQ_INIT(&nd6_list);
pool_init(&nd6_pool, sizeof(struct llinfo_nd6), 0,
IPL_SOFTNET, 0, "nd6", NULL);
- task_set(&nd6_expire_task, nd6_expire, NULL);
-
nd6_init_done = 1;
/* start timer */
- timeout_set_proc(&nd6_timer_to, nd6_timer, NULL);
- timeout_set_proc(&nd6_slowtimo_ch, nd6_slowtimo, NULL);
timeout_add_sec(&nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL);
- timeout_set(&nd6_expire_timeout, nd6_expire_timer, NULL);
}
struct nd_ifinfo *