diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-02-03 13:40:46 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-02-03 13:40:46 +0000 |
commit | 60c6f58cd9fc50f82e3e2e637b40fe29b7e83bac (patch) | |
tree | f693dbc06b65fd2f24b466e53ad25eafabe7e5c5 /sbin/pfctl/parse.y | |
parent | 18a8f4b1d9fd6f8ca7b200916d51f2a12bd88dab (diff) |
fix a problem with queue definitions when load options (like -N etc) are
given; they used to check for their parent interface/queue even in this
case.
ok dhartmei@ cedric@
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r-- | sbin/pfctl/parse.y | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 3d6c01a1ea3..62b97545ba6 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.302 2003/02/02 23:22:07 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.303 2003/02/03 13:40:45 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -3022,6 +3022,12 @@ expand_altq(struct pf_altq *a, struct node_if *interfaces, struct node_queue *n; int errs = 0; + if ((pf->loadopt & (PFCTL_FLAG_ALTQ | PFCTL_FLAG_ALL)) == 0) { + FREE_LIST(struct node_if, interfaces); + FREE_LIST(struct node_queue, nqueues); + return (0); + } + LOOP_THROUGH(struct node_if, interface, interfaces, memcpy(&pa, a, sizeof(struct pf_altq)); if (strlcpy(pa.ifname, interface->ifname, @@ -3119,6 +3125,11 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues, u_int8_t added = 0; u_int8_t found = 0; + if ((pf->loadopt & (PFCTL_FLAG_ALTQ | PFCTL_FLAG_ALL)) == 0) { + FREE_LIST(struct node_queue, nqueues); + return (0); + } + LOOP_THROUGH(struct node_queue, tqueue, queues, if (!strncmp(a->qname, tqueue->queue, PF_QNAME_SIZE)) { /* found ourselve in queues */ |