summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2002-11-23 18:32:30 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2002-11-23 18:32:30 +0000
commit0ea4798d6e4f954cc2f5f78bd210b8e0e9a97373 (patch)
tree8ff729c165752ba746b9bfbc74735e8f05fa64ef /sbin
parent63176eda89144500f6841860345f08f6f4dd8ce9 (diff)
better error checking in expand_queue
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index eddbb7989e2..52d55c5ead0 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.206 2002/11/23 18:27:28 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.207 2002/11/23 18:32:29 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -2529,9 +2529,11 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues,
strlcpy(a->ifname, tqueue->ifname, IFNAMSIZ);
strlcpy(a->parent, tqueue->parent, PF_QNAME_SIZE);
- eval_pfqueue(pf, a, bwspec.bw_absolute,
- bwspec.bw_percent);
- pfctl_add_altq(pf, a);
+ if (!eval_pfqueue(pf, a, bwspec.bw_absolute,
+ bwspec.bw_percent))
+ if(!pfctl_add_altq(pf, a))
+ added++;
+
if (pf->opts & PF_OPT_VERBOSE) {
print_altq(&pf->paltq->altq, 0);
if (nqueues && nqueues->tail) {
@@ -2544,7 +2546,6 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues,
}
printf("\n");
}
- added++;
FREE_LIST(struct node_queue, nqueues);
}
);