diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 19:16:29 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 19:16:29 +0200 |
commit | 2ffca7de4ef14aa03bc5a855005edbc9849862a7 (patch) | |
tree | 7168a61299fd0e6b79b6d440018bab6db3914c54 /src/config.c | |
parent | e89cfb2f0b8159f602ecae6b53c0ee59b112601d (diff) | |
download | fastd-2ffca7de4ef14aa03bc5a855005edbc9849862a7.tar fastd-2ffca7de4ef14aa03bc5a855005edbc9849862a7.zip |
Move around some structure fields
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); } |