diff options
author | 2003-02-09 15:04:04 +0000 | |
---|---|---|
committer | 2003-02-09 15:04:04 +0000 | |
commit | b51a3af95fc112e95d6b73d3593a3c5921bc6490 (patch) | |
tree | 49d1d953201f2f77bcf213b639a00fab5bdd9997 | |
parent | Swiss French ADB keyboard layout, tested against Powerbook keyboard markings, (diff) | |
download | wireguard-openbsd-b51a3af95fc112e95d6b73d3593a3c5921bc6490.tar.xz wireguard-openbsd-b51a3af95fc112e95d6b73d3593a3c5921bc6490.zip |
more live code from FOSDEM:
make
pass in proto tcp to port 80
work.
-allow to omit the "any" if you're specifying a port
-allow to omit the from or to part if you want "any" for the other
ok dhartmei@ pb@
-rw-r--r-- | sbin/pfctl/parse.y | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 9d24d8df054..c7395aa41bf 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.311 2003/02/09 13:50:44 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.312 2003/02/09 15:04:04 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -378,7 +378,7 @@ typedef struct { %type <v.icmp> icmp_list icmp_item %type <v.icmp> icmp6_list icmp6_item %type <v.fromto> fromto -%type <v.peer> ipportspec +%type <v.peer> ipportspec from to %type <v.host> ipspec xhost host address host_list %type <v.host> redir_host_list redirspec %type <v.host> route_host route_host_list routespec @@ -1477,21 +1477,33 @@ proto_item : STRING { } ; -fromto : /* empty */ { +fromto : ALL { $$.src.host = NULL; $$.src.port = NULL; $$.dst.host = NULL; $$.dst.port = NULL; } - | ALL { - $$.src.host = NULL; - $$.src.port = NULL; - $$.dst.host = NULL; - $$.dst.port = NULL; + | from to { + $$.src = $1; + $$.dst = $2; } - | FROM ipportspec TO ipportspec { - $$.src = $2; - $$.dst = $4; + ; + +from : /* empty */ { + $$.host = NULL; + $$.port = NULL; + } + | FROM ipportspec { + $$ = $2; + } + ; + +to : /* empty */ { + $$.host = NULL; + $$.port = NULL; + } + | TO ipportspec { + $$ = $2; } ; @@ -1500,6 +1512,10 @@ ipportspec : ipspec { $$.host = $1; $$.port = NULL; } $$.host = $1; $$.port = $3; } + | PORT portspec { + $$.host = NULL; + $$.port = $2; + } ; ipspec : ANY { $$ = NULL; } |