diff options
-rw-r--r-- | sys/kern/uipc_mbuf.c | 24 | ||||
-rw-r--r-- | sys/net/if.c | 23 |
2 files changed, 23 insertions, 24 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 9c9cae4d301..d83ec600af2 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.134 2009/09/13 14:42:52 krw Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.135 2010/01/12 04:05:45 deraadt Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -115,6 +115,10 @@ int max_protohdr; /* largest protocol header */ int max_hdr; /* largest link+protocol header */ int max_datalen; /* MHLEN - max_hdr */ +struct timeout m_cltick_tmo; +int m_clticks; +void m_cltick(void *); + void m_extfree(struct mbuf *); struct mbuf *m_copym0(struct mbuf *, int, int, int, int); void nmbclust_update(void); @@ -143,6 +147,9 @@ mbinit(void) } nmbclust_update(); + + timeout_set(&m_cltick_tmo, m_cltick, NULL); + m_cltick(NULL); } void @@ -298,7 +305,20 @@ m_clsetwms(struct ifnet *ifp, u_int pktlen, u_int lwm, u_int hwm) ifp->if_data.ifi_mclpool[pi].mcl_hwm = hwm; } -extern int m_clticks; +/* + * Record when the last timeout has been run. If the delta is + * too high, m_cldrop() will notice and decrease the interface + * high water marks. + */ +void +m_cltick(void *arg) +{ + extern int ticks; + + m_clticks = ticks; + timeout_add(&m_cltick_tmo, 1); +} + int m_livelock; int diff --git a/sys/net/if.c b/sys/net/if.c index c0f3919423b..af12ed94496 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.203 2010/01/08 19:21:19 stsp Exp $ */ +/* $OpenBSD: if.c,v 1.204 2010/01/12 04:05:47 deraadt Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -152,24 +152,6 @@ TAILQ_HEAD(, ifg_group) ifg_head; LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners); int if_cloners_count; -struct timeout m_cltick_tmo; -int m_clticks; - -/* - * Record when the last timeout has been run. If the delta is - * too high, m_cldrop() will notice and decrease the interface - * high water marks. - */ -static void -m_cltick(void *arg) -{ - extern int ticks; - extern void m_cltick(void *); - - m_clticks = ticks; - timeout_add(&m_cltick_tmo, 1); -} - /* * Network interface utility routines. * @@ -184,9 +166,6 @@ ifinit() timeout_set(&if_slowtim, if_slowtimo, &if_slowtim); if_slowtimo(&if_slowtim); - - timeout_set(&m_cltick_tmo, m_cltick, NULL); - m_cltick(NULL); } static int if_index = 0; |