diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-28 12:17:05 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-28 12:17:05 +0000 |
commit | 2bfaabeb4bbcde09c7f481379268a5acd248fdec (patch) | |
tree | 68873ace3e35169d210ffc6325769867e5e628dd | |
parent | 2e5252c49a70e57114f167f79929af87493833e2 (diff) |
move '!' from host_list to host: "xhost : '!' host | host;"; ok dhartmei@
-rw-r--r-- | regress/sbin/pfctl/Makefile | 4 | ||||
-rw-r--r-- | regress/sbin/pfctl/pf8.in | 2 | ||||
-rw-r--r-- | regress/sbin/pfctl/pf8.ok | 3 | ||||
-rw-r--r-- | sbin/pfctl/parse.y | 20 |
4 files changed, 16 insertions, 13 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile index ede9e881d46..8deecc444b0 100644 --- a/regress/sbin/pfctl/Makefile +++ b/regress/sbin/pfctl/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.5 2001/08/25 21:54:26 frantzen Exp $ +# $OpenBSD: Makefile,v 1.6 2001/08/28 12:17:04 markus Exp $ NOMAN= NOPROG= -PFTESTS=1 2 3 4 5 6 7 +PFTESTS=1 2 3 4 5 6 7 8 pfail1: @pfctl -nv -R - < ${.CURDIR}/pfail1.in > /dev/null 2>&1 || \ diff --git a/regress/sbin/pfctl/pf8.in b/regress/sbin/pfctl/pf8.in new file mode 100644 index 00000000000..fd625c7deaf --- /dev/null +++ b/regress/sbin/pfctl/pf8.in @@ -0,0 +1,2 @@ +extern = "{ ! 10.0.0.0/8, 10.1.2.3 }" +block out log on rl0 from $extern to any diff --git a/regress/sbin/pfctl/pf8.ok b/regress/sbin/pfctl/pf8.ok new file mode 100644 index 00000000000..535f0e03b94 --- /dev/null +++ b/regress/sbin/pfctl/pf8.ok @@ -0,0 +1,3 @@ +extern = { ! 10.0.0.0/8, 10.1.2.3 } +@1 block out log on rl0 from 10.1.2.3 to any +@1 block out log on rl0 from ! 10.0.0.0/255.0.0.0 to any diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 6755f02c5a1..84772aa4cfd 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.26 2001/08/28 09:54:14 markus Exp $ */ +/* $OpenBSD: parse.y,v 1.27 2001/08/28 12:17:04 markus Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -140,7 +140,7 @@ typedef struct { %type <v.proto> proto proto_list proto_item %type <v.fromto> fromto %type <v.peer> ipportspec -%type <v.host> ipspec host address host_list +%type <v.host> ipspec xhost host address host_list %type <v.port> portspec port_list port_item %% @@ -309,19 +309,17 @@ ipportspec : ipspec { $$.host = $1; $$.port = NULL; } ; ipspec : ANY { $$ = NULL; } - | '!' host { $$ = $2; $$->not = 1; } - | host { $$ = $1; } + | xhost { $$ = $1; } | '{' host_list '}' { $$ = $2; } ; -host_list : '!' host { $$ = $2; $$->not = 1; } +host_list : xhost { $$ = $1; } + | host_list ',' xhost { $3->next = $1; $$ = $3; } + ; + +xhost : '!' 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 { $$ = $1; |