summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-07-10 18:20:17 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-07-10 18:20:17 +0200
commitebcf28b9ab43d71179535df61896aa8baa4cdb27 (patch)
tree79a1f7946a977b958d1eeef395607562eddecb09
parentebe85fa478308db1d38ec7ab659d6778994f6e3b (diff)
downloadfastd-ebcf28b9ab43d71179535df61896aa8baa4cdb27.tar
fastd-ebcf28b9ab43d71179535df61896aa8baa4cdb27.zip
config: fix basic config checks in TUN mode
-rw-r--r--src/config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/config.c b/src/config.c
index 1e6cff7..343823b 100644
--- a/src/config.c
+++ b/src/config.c
@@ -519,12 +519,14 @@ static void config_check_base(void) {
}
if (conf.mode == MODE_TUN) {
- if (conf.peers->next)
- exit_error("config error: in TUN mode exactly one peer must be configured");
- if (conf.peer_group->children)
- exit_error("config error: in TUN mode peer groups can't be used");
if (has_peer_group_peer_dirs(conf.peer_group))
exit_error("config error: in TUN mode peer directories can't be used");
+
+ if (conf.peer_group->children)
+ exit_error("config error: in TUN mode peer groups can't be used");
+
+ if (conf.peers && conf.peers->next)
+ exit_error("config error: in TUN mode exactly one peer must be configured");
}
#ifndef USE_PMTU