diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-05-05 13:57:42 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-05-05 13:57:42 +0000 |
commit | 8437b48037b2a2f1285d7f8619f47f66e4108b86 (patch) | |
tree | 2c6acef0db20be9abd328a50b0e1b7c112854753 /sys/netinet/ip_input.c | |
parent | 432c887f3c3f84ce6c325dac0fa5d77d44e4ce22 (diff) |
Use static objects for struct rttimer_queue instead of dynamically
allocate them.
Currently there are 6 rttimer_queues and not many more will follow. So
change rt_timer_queue_create() to rt_timer_queue_init() which now takes
a struct rttimer_queue * as argument which will be initialized.
Since this changes the gloabl vars from pointer to struct adjust other
callers as well.
OK bluhm@
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index eba9bbe9b55..a0ef01bc55d 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.370 2022/05/04 16:52:10 claudio Exp $ */ +/* $OpenBSD: ip_input.c,v 1.371 2022/05/05 13:57:40 claudio Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -221,7 +221,7 @@ ip_init(void) ipsec_init(); #endif #ifdef MROUTING - ip_mrouterq = rt_timer_queue_create(MCAST_EXPIRE_FREQUENCY, + rt_timer_queue_init(&ip_mrouterq, MCAST_EXPIRE_FREQUENCY, &mfc_expire_route); #endif } @@ -1655,14 +1655,14 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, NET_LOCK(); error = sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtudisc); if (ip_mtudisc == 0) - rt_timer_queue_flush(ip_mtudisc_timeout_q); + rt_timer_queue_flush(&ip_mtudisc_timeout_q); NET_UNLOCK(); return error; case IPCTL_MTUDISCTIMEOUT: NET_LOCK(); error = sysctl_int_bounded(oldp, oldlenp, newp, newlen, &ip_mtudisc_timeout, 0, INT_MAX); - rt_timer_queue_change(ip_mtudisc_timeout_q, + rt_timer_queue_change(&ip_mtudisc_timeout_q, ip_mtudisc_timeout); NET_UNLOCK(); return (error); |