summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-07-19 12:51:32 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-07-19 12:51:32 +0000
commit5c19c20296730b291c1591907f0230de60c5b9d3 (patch)
treefa475be14120668b462db4d5cb1710d1bdbb2dd8 /sbin/pfctl/parse.y
parenta98649ea9a316bae378f0491bc7c03ff5266248b (diff)
Rework HFSC vs FQ-CoDel checks
The selection mechanism introduced in pf_ioctl.c -r1.316 suffers from being too ambiguous and lacks robustness. Instead of relying on composition of multiple flags in the queue specification, it's easier to identify the root class (if it exists) and derive all further checks from it.
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r--sbin/pfctl/parse.y15
1 files changed, 7 insertions, 8 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index f45c0980e8b..5ab84c9fa8e 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.660 2017/05/28 15:15:21 akfaew Exp $ */
+/* $OpenBSD: parse.y,v 1.661 2017/07/19 12:51:30 mikeb Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -395,7 +395,7 @@ typedef struct {
int i;
char *string;
u_int rtableid;
- u_int16_t weight;
+ u_int16_t weight;
struct {
u_int8_t b1;
u_int8_t b2;
@@ -1304,10 +1304,6 @@ queuespec : QUEUE STRING interface queue_opts {
yyerror("root queue without interface");
YYERROR;
}
- if ($2[0] == '_') {
- yyerror("queue names must not start with _");
- YYERROR;
- }
expand_queue($2, $3, &$4);
}
;
@@ -4343,8 +4339,11 @@ expand_queue(char *qname, struct node_if *interfaces, struct queue_opts *opts)
LOOP_THROUGH(struct node_if, interface, interfaces,
bzero(&qspec, sizeof(qspec));
- if ((opts->flags & PFQS_FLOWQUEUE) && opts->parent) {
- yyerror("discipline doesn't support hierarchy");
+ if (!opts->parent && (opts->marker & QOM_BWSPEC))
+ opts->flags |= PFQS_ROOTCLASS;
+ if (!(opts->marker & QOM_BWSPEC) &&
+ !(opts->marker & QOM_FLOWS)) {
+ yyerror("no bandwidth or flow specification");
return (1);
}
if (strlcpy(qspec.qname, qname, sizeof(qspec.qname)) >=