summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2013-01-16 01:49:21 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2013-01-16 01:49:21 +0000
commitad612b236fa920d5173781da905359e408b406a0 (patch)
tree24ef9257b277dec69169100655dc013f63c0e0bb /sbin
parent2c930626ad8206aed974aa937c131fe2c1c92143 (diff)
for consistency with prio etc, the queue assignment really belongs
into the set block. so make pfctl accept, print and the manpage document . match set queue foo instead of . match queue foo but keep accepting the old way without the explicit set. ok bob, man jmc
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y9
-rw-r--r--sbin/pfctl/pfctl_parser.c16
2 files changed, 18 insertions, 7 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index bf2e7923f2c..359d1a97b63 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.620 2012/10/18 15:18:57 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.621 2013/01/16 01:49:20 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -2372,6 +2372,13 @@ filter_set : prio {
filter_opts.set_prio[0] = $1.b1;
filter_opts.set_prio[1] = $1.b2;
}
+ | QUEUE qname {
+ if (filter_opts.queues.qname) {
+ yyerror("queue cannot be redefined");
+ YYERROR;
+ }
+ filter_opts.queues = $2;
+ }
| TOS tos {
if (filter_opts.marker & FOM_SETTOS) {
yyerror("tos cannot be respecified");
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index c21dec4ac43..f7c46661789 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.291 2012/12/04 02:24:46 deraadt Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.292 2013/01/16 01:49:20 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -841,7 +841,7 @@ print_rule(struct pf_rule *r, const char *anchor_call, int opts)
if (r->tos)
printf(" tos 0x%2.2x", r->tos);
- if (r->scrub_flags & PFSTATE_SETMASK) {
+ if (r->scrub_flags & PFSTATE_SETMASK || r->qname[0]) {
char *comma = "";
printf(" set (");
if (r->scrub_flags & PFSTATE_SETPRIO) {
@@ -852,6 +852,14 @@ print_rule(struct pf_rule *r, const char *anchor_call, int opts)
r->set_prio[1]);
comma = ",";
}
+ if (r->qname[0]) {
+ if (r->pqname[0])
+ printf("%s queue(%s, %s)", comma, r->qname,
+ r->pqname);
+ else
+ printf("%s queue %s", comma, r->qname);
+ comma = ",";
+ }
if (r->scrub_flags & PFSTATE_SETTOS) {
printf("%s tos 0x%2.2x", comma, r->set_tos);
comma = ",";
@@ -1035,10 +1043,6 @@ print_rule(struct pf_rule *r, const char *anchor_call, int opts)
printf(" label \"%s\"", r->label);
if (r->rule_flag & PFRULE_ONCE)
printf(" once");
- if (r->qname[0] && r->pqname[0])
- printf(" queue(%s, %s)", r->qname, r->pqname);
- else if (r->qname[0])
- printf(" queue %s", r->qname);
if (r->tagname[0])
printf(" tag %s", r->tagname);
if (r->match_tagname[0]) {