summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-08-28 09:27:17 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-08-28 09:27:17 +0000
commit2d4778a29a151bd4541fdd3d6f24c9c6d47673bc (patch)
treeb52c677bba8342c434d7e0ff224e3c7c55cb1c14 /sbin
parent6b61600fc0ccf34584043c8c561d188a9d6bc5cd (diff)
Support ! operator in host parameter lists. Fixes PR system/2030. Reported
by Kamil Andrusz <wizz@mniam.net>.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 868fc34970e..dda612bcc28 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.24 2001/08/26 07:58:40 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.25 2001/08/28 09:27:16 dhartmei Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -299,11 +299,17 @@ ipportspec : ipspec { $$.host = $1; $$.port = NULL; }
ipspec : ANY { $$ = NULL; }
| '!' host { $$ = $2; $$->not = 1; }
- | host { $$ = $1; $$->not = 0; }
+ | host { $$ = $1; }
| '{' host_list '}' { $$ = $2; }
;
-host_list : host { $$ = $1; }
+host_list : '!' host { $$ = $2; $$->not = 1; }
+ | host { $$ = $1; }
+ | host_list ',' '!' host {
+ $4->next = $1;
+ $4->not = 1;
+ $$ = $4;
+ }
| host_list ',' host { $3->next = $1; $$ = $3; }
host : address {