diff options
-rw-r--r-- | sbin/ipsecctl/parse.y | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y index 791d9d47619..057d0548091 100644 --- a/sbin/ipsecctl/parse.y +++ b/sbin/ipsecctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.79 2006/05/29 18:50:27 hshoexer Exp $ */ +/* $OpenBSD: parse.y,v 1.80 2006/05/29 20:12:14 hshoexer Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -241,7 +241,7 @@ typedef struct { %type <v.hosts> hosts %type <v.peers> peers %type <v.singlehost> singlehost -%type <v.host> host +%type <v.host> host host_list %type <v.ids> ids %type <v.id> id %type <v.spis> spispec @@ -284,6 +284,10 @@ number : STRING { } ; +comma : ',' + | /* empty */ + ; + tcpmd5rule : TCPMD5 hosts spispec authkeyspec { struct ipsec_rule *r; @@ -419,6 +423,20 @@ singlehost : /* empty */ { $$ = NULL; } } ; +host_list : host { $$ = $1; } + | host_list comma host { + if ($3 == NULL) + $$ = $1; + else if ($1 == NULL) + $$ = $3; + else { + $1->tail->next = $3; + $1->tail = $3->tail; + $$ = $1; + } + } + ; + host : STRING { if (($$ = host($1)) == NULL) { free($1); @@ -453,6 +471,7 @@ host : STRING { err(1, "host: strdup"); $$ = ipa; } + | '{' host_list '}' { $$ = $2; } ; ids : /* empty */ { |