summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 22:52:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 22:52:25 +0200
commit21ade840c989e9fcebef63e2999f5c31843c47b6 (patch)
tree54bac8e630858a22824262c91f0f71297c4feb34 /src/fastd.c
parentc9c7cbb67c8a3cff9241bee1e1b1902be4e0a799 (diff)
downloadfastd-21ade840c989e9fcebef63e2999f5c31843c47b6.tar
fastd-21ade840c989e9fcebef63e2999f5c31843c47b6.zip
Unify enabled and dynamic flags into a config_state flag
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fastd.c b/src/fastd.c
index e39a1bc..0be82c4 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -212,10 +212,10 @@ static void init_peers(void) {
for (peer_conf = ctx.peer_configs; peer_conf; peer_conf = peer_conf->next) {
bool enable = conf.protocol->peer_check(peer_conf);
- if (enable && !peer_conf->enabled)
+ if (enable && peer_conf->config_state == CONFIG_DISABLED)
fastd_peer_add(peer_conf);
- peer_conf->enabled = enable;
+ peer_conf->config_state = enable ? CONFIG_STATIC : CONFIG_DISABLED;
}
size_t i;
@@ -229,7 +229,7 @@ static void init_peers(void) {
}
}
else {
- if (!peer->config->enabled) {
+ if (peer->config->config_state == CONFIG_DISABLED) {
pr_info("previously enabled peer %P disabled, deleting.", peer);
fastd_peer_delete(peer);
continue;