From 2ffca7de4ef14aa03bc5a855005edbc9849862a7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Mar 2012 19:16:29 +0200 Subject: Move around some structure fields --- src/config.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index f21e875..6f0b3cf 100644 --- a/src/config.c +++ b/src/config.c @@ -248,6 +248,8 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con current_peer->next = conf->peers; conf->peers = current_peer; + current_peer->enabled = true; + memset(¤t_peer->address, 0, sizeof(fastd_peer_address)); if (strcmp(arg, "float") == 0) { current_peer->address.sa.sa_family = AF_UNSPEC; @@ -339,12 +341,8 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con conf->bind_addr_in6.sin6_family = AF_INET6; } - bool ok = true; - if (conf->mode == MODE_TUN && (!conf->peers || conf->peers->next)) { - pr_error(ctx, "for tun mode exactly one peer must be configured"); - ok = false; - } + if (conf->mode == MODE_TUN && (!conf->peers || conf->peers->next)) + exit_error(ctx, "config error: for tun mode exactly one peer must be configured"); - if (!ok) - exit_error(ctx, "config error"); + conf->protocol->init(ctx, conf); } -- cgit v1.2.3