summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenjiro Cho <kjc@cvs.openbsd.org>2002-05-31 09:46:13 +0000
committerKenjiro Cho <kjc@cvs.openbsd.org>2002-05-31 09:46:13 +0000
commitc1ca08fe37eb119e7f2c1aee3555f1a546c29006 (patch)
treee53340b4a08208394a0fdf1ac9aed7e053592044
parent0f930e8154839db1c2292005bd1f166f6d5bfd4c (diff)
fail if the default class is smaller than the ctl class.
report by Paul Civati <paul@xciv.org>
-rw-r--r--usr.sbin/altq/libaltq/qop_cbq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/altq/libaltq/qop_cbq.c b/usr.sbin/altq/libaltq/qop_cbq.c
index 3eb7438f7dc..f0e77d189f2 100644
--- a/usr.sbin/altq/libaltq/qop_cbq.c
+++ b/usr.sbin/altq/libaltq/qop_cbq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qop_cbq.c,v 1.3 2001/12/03 08:38:48 kjc Exp $ */
+/* $OpenBSD: qop_cbq.c,v 1.4 2002/05/31 09:46:12 kjc Exp $ */
/* $KAME: qop_cbq.c,v 1.5 2001/08/16 10:39:14 kjc Exp $ */
/*
* Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
@@ -342,6 +342,9 @@ qcmd_cbq_add_class(const char *ifname, const char *class_name,
/* reserve bandwidth for ctl_class */
ctl_bandwidth =
ifinfo->bandwidth / 100 * CTL_PBANDWIDTH;
+ if (bandwidth <= ctl_bandwidth)
+ LOG(LOG_ERR, 0,
+ "bandwidth for default class too small!");
bandwidth -= ctl_bandwidth;
}
}