summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 22:01:38 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 22:01:38 +0200
commit5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b (patch)
tree277a0d2b69cc2ba69cbeff2e6f4fbb4eb39080f0 /src/fastd.c
parent2352e1a79e6f77cb894f5b65b1632e27cd0695a9 (diff)
downloadfastd-5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b.tar
fastd-5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b.zip
peer: add a flag `dynamic' instead of checking the config field for NULL
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fastd.c b/src/fastd.c
index c67c875..e7f7621 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -222,15 +222,15 @@ static void init_peers(void) {
for (i = 0; i < VECTOR_LEN(ctx.peers);) {
fastd_peer_t *peer = VECTOR_INDEX(ctx.peers, i);
- if (peer->config) {
- if (!peer->config->enabled) {
- pr_info("previously enabled peer %P disabled, deleting.", peer);
+ if (fastd_peer_is_dynamic(peer)) {
+ if (!conf.protocol->peer_check_dynamic(peer)) {
fastd_peer_delete(peer);
continue;
}
}
else {
- if (!conf.protocol->peer_check_dynamic(peer)) {
+ if (!peer->config->enabled) {
+ pr_info("previously enabled peer %P disabled, deleting.", peer);
fastd_peer_delete(peer);
continue;
}