summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-11-10 14:55:41 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-11-10 14:55:41 +0100
commit13c71785b58fe542ca95eeed11dabf99f1be71fa (patch)
treec5e9469af5de6dbba2a2b79b598678bff576e31a /src/config.y
parent68b33305cc7d258b5556a30f6cb96e1882bda0d7 (diff)
downloadfastd-13c71785b58fe542ca95eeed11dabf99f1be71fa.tar
fastd-13c71785b58fe542ca95eeed11dabf99f1be71fa.zip
Don't allow global config statements in peer groups
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/config.y b/src/config.y
index 5e3e837..d576b91 100644
--- a/src/config.y
+++ b/src/config.y
@@ -51,6 +51,7 @@
}
%token START_CONFIG
+%token START_PEER_GROUP_CONFIG
%token START_PEER_CONFIG
%token <num> TOK_INTEGER
@@ -131,6 +132,7 @@
%%
start: START_CONFIG config
+ | START_PEER_GROUP_CONFIG peer_group_config
| START_PEER_CONFIG peer_conf
;
@@ -138,7 +140,13 @@ config: config statement
|
;
-statement: TOK_LOG log ';'
+peer_group_config:
+ peer_group_config peer_group_statement
+ |
+ ;
+
+statement: peer_group_statement
+ | TOK_LOG log ';'
| TOK_INTERFACE interface ';'
| TOK_BIND bind ';'
| TOK_MTU mtu ';'
@@ -151,10 +159,13 @@ statement: TOK_LOG log ';'
| TOK_ON TOK_DOWN on_down ';'
| TOK_ON TOK_ESTABLISH on_establish ';'
| TOK_ON TOK_DISESTABLISH on_disestablish ';'
- | TOK_PEER peer '{' peer_conf '}'
- | TOK_PEER TOK_GROUP peer_group '{' config '}' peer_group_after
- | TOK_PEER TOK_LIMIT peer_limit ';'
| TOK_FORWARD forward ';'
+ ;
+
+peer_group_statement:
+ TOK_PEER peer '{' peer_conf '}'
+ | TOK_PEER TOK_GROUP peer_group '{' peer_group_config '}' peer_group_after
+ | TOK_PEER TOK_LIMIT peer_limit ';'
| TOK_INCLUDE include ';'
;