Don't use the static CALLOUT_INITIALIZER for __FreeBSD_version >= 600000. It
was a bad idea, but since it is done like this in the vendor source we keep it around for older versions. As a safe guard against future misuse we don't even define CALLOUT_INITIALIZER anymore. This fixes ALTQ after callout_init_mtx() and takes altq_var.h off the vendor branch. Submitted by: Divacky Roman <xdivac02NOstud.fit.vutbrSPAMcz> (w/ changes)
This commit is contained in:
parent
5003a52a0c
commit
a448425842
@ -93,7 +93,11 @@ static void tbr_timeout(void *);
|
||||
int (*altq_input)(struct mbuf *, int) = NULL;
|
||||
static struct mbuf *tbr_dequeue(struct ifaltq *, int);
|
||||
static int tbr_timer = 0; /* token bucket regulator timer */
|
||||
#if !defined(__FreeBSD__) || (__FreeBSD_version < 600000)
|
||||
static struct callout tbr_callout = CALLOUT_INITIALIZER;
|
||||
#else
|
||||
static struct callout tbr_callout;
|
||||
#endif
|
||||
|
||||
#ifdef ALTQ3_CLFIER_COMPAT
|
||||
static int extract_ports4(struct mbuf *, struct ip *, struct flowinfo_in *);
|
||||
@ -932,6 +936,9 @@ init_machclk(void)
|
||||
#ifdef __FreeBSD__
|
||||
#if (__FreeBSD_version > 300000)
|
||||
machclk_freq = tsc_freq;
|
||||
#if (__FreeBSD_version >= 600000)
|
||||
callout_init(&tbr_callout, 0);
|
||||
#endif
|
||||
#else
|
||||
machclk_freq = i586_ctr_freq;
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $ */
|
||||
|
||||
/*
|
||||
@ -175,7 +176,7 @@ typedef u_long ioctlcmd_t;
|
||||
#endif
|
||||
#define CALLOUT_RESET(c,t,f,a) callout_reset((c),(t),(f),(a))
|
||||
#define CALLOUT_STOP(c) callout_stop((c))
|
||||
#ifndef CALLOUT_INITIALIZER
|
||||
#if !defined(CALLOUT_INITIALIZER) && (__FreeBSD_version < 600000)
|
||||
#define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 }
|
||||
#endif
|
||||
#elif defined(__OpenBSD__)
|
||||
|
Loading…
Reference in New Issue
Block a user