summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_altq.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-10 14:54:18 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-10 14:54:18 +0000
commit21bd9e1343a8b29304a144042009d6abd6a12c78 (patch)
tree69604a44586e3015798ec1b6c04655b16b5f68f5 /sbin/pfctl/pfctl_altq.c
parent8169288f68f4a23496c847fb7bccd31405a7223d (diff)
check for multiple same named queues on one interface.
before this was rejected at load time with a rather useless error message, now a nice error message points out the actual error. inspired by an error report from Damien Miller ok dhartmei@ pb@ (monsterdiff complete)
Diffstat (limited to 'sbin/pfctl/pfctl_altq.c')
-rw-r--r--sbin/pfctl/pfctl_altq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index f36d2a6561c..f412fd9f5d3 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.44 2003/03/10 14:48:38 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.45 2003/03/10 14:54:17 henning Exp $ */
/*
* Copyright (C) 2002
@@ -323,6 +323,12 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, u_int32_t bw_absolute,
}
pa->scheduler = if_pa->scheduler;
pa->ifbandwidth = if_pa->ifbandwidth;
+
+ if (qname_to_pfaltq(pa->qname, pa->ifname) != NULL) {
+ fprintf(stderr, "queue %s already exists on interface %s\n",
+ pa->qname, pa->ifname);
+ return (1);
+ }
pa->qid = qname_to_qid(pa->qname);
parent = NULL;