summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-03-10 14:54:17 +0000
committerhenning <henning@openbsd.org>2003-03-10 14:54:17 +0000
commite1280a7135aa7e061aa55eb184c53f2fd81ba7d5 (patch)
treee7c0b9dba2e7c2f94b30726b6b7ed0312b3dbfc9
parentcorrectly cope with errors returned by eval_pfqueue and pfctl_add_altq (diff)
downloadwireguard-openbsd-e1280a7135aa7e061aa55eb184c53f2fd81ba7d5.tar.xz
wireguard-openbsd-e1280a7135aa7e061aa55eb184c53f2fd81ba7d5.zip
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)
-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;