summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-01-13 05:20:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-01-13 05:20:11 +0000
commit47cd6bdef86cd2b86f40b7517d8eb45a0024e495 (patch)
tree8a9071bdc31c2a52409895e186e4b3196c63ff33 /sbin/pfctl
parent7a61d7bf098336174773f39972cd55e79f187cb0 (diff)
Move tokens before productions into more consistant places
ok mcbride
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/parse.y44
1 files changed, 22 insertions, 22 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 6fae5cf5f3e..a6ffe42d12a 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.587 2010/01/13 00:56:13 mcbride Exp $ */
+/* $OpenBSD: parse.y,v 1.588 2010/01/13 05:20:10 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -1144,12 +1144,12 @@ antispoof_opts_l : antispoof_opts_l antispoof_opt
| antispoof_opt
;
-antispoof_opt : label {
+antispoof_opt : LABEL label {
if (antispoof_opts.label) {
yyerror("label cannot be redefined");
YYERROR;
}
- antispoof_opts.label = $1;
+ antispoof_opts.label = $2;
}
| RTABLE NUMBER {
if ($2 < 0 || $2 > RT_TABLEID_MAX) {
@@ -2171,19 +2171,19 @@ filter_opt : USER uids {
| ALLOWOPTS {
filter_opts.allowopts = 1;
}
- | label {
+ | LABEL label {
if (filter_opts.label) {
yyerror("label cannot be redefined");
YYERROR;
}
- filter_opts.label = $1;
+ filter_opts.label = $2;
}
- | qname {
+ | QUEUE qname {
if (filter_opts.queues.qname) {
yyerror("queue cannot be redefined");
YYERROR;
}
- filter_opts.queues = $1;
+ filter_opts.queues = $2;
}
| TAG string {
filter_opts.tag = $2;
@@ -2661,7 +2661,7 @@ ipportspec : ipspec {
;
optnl : '\n' optnl
- |
+ | /* empty */
;
ipspec : ANY { $$ = NULL; }
@@ -3329,9 +3329,9 @@ tos : STRING {
}
;
-sourcetrack : SOURCETRACK { $$ = PF_SRCTRACK; }
- | SOURCETRACK GLOBAL { $$ = PF_SRCTRACK_GLOBAL; }
- | SOURCETRACK RULE { $$ = PF_SRCTRACK_RULE; }
+sourcetrack : /* empty */ { $$ = PF_SRCTRACK; }
+ | GLOBAL { $$ = PF_SRCTRACK_GLOBAL; }
+ | RULE { $$ = PF_SRCTRACK_RULE; }
;
statelock : IFBOUND {
@@ -3472,12 +3472,12 @@ state_opt_item : MAXIMUM NUMBER {
$$->next = NULL;
$$->tail = $$;
}
- | sourcetrack {
+ | SOURCETRACK sourcetrack {
$$ = calloc(1, sizeof(struct node_state_opt));
if ($$ == NULL)
err(1, "state_opt_item: calloc");
$$->type = PF_STATE_OPT_SRCTRACK;
- $$->data.src_track = $1;
+ $$->data.src_track = $2;
$$->next = NULL;
$$->tail = $$;
}
@@ -3538,22 +3538,22 @@ state_opt_item : MAXIMUM NUMBER {
}
;
-label : LABEL STRING {
- $$ = $2;
+label : STRING {
+ $$ = $1;
}
;
-qname : QUEUE STRING {
- $$.qname = $2;
+qname : STRING {
+ $$.qname = $1;
$$.pqname = NULL;
}
- | QUEUE '(' STRING ')' {
- $$.qname = $3;
+ | '(' STRING ')' {
+ $$.qname = $2;
$$.pqname = NULL;
}
- | QUEUE '(' STRING comma STRING ')' {
- $$.qname = $3;
- $$.pqname = $5;
+ | '(' STRING comma STRING ')' {
+ $$.qname = $2;
+ $$.pqname = $4;
}
;