summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-16 07:29:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-16 07:29:55 +0200
commit872e0dfa86417e89022f84ac78b2d90236cb97d4 (patch)
tree640c04570466a9cf2d06eece32fdb5c07afde6cb /src/config.c
parent3a87d747a015b2ff2150ed163ad56b1bc677e6b0 (diff)
downloadfastd-872e0dfa86417e89022f84ac78b2d90236cb97d4.tar
fastd-872e0dfa86417e89022f84ac78b2d90236cb97d4.zip
Lots of fixes and improvements on the resolver code
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index e7c8640..d581ccf 100644
--- a/src/config.c
+++ b/src/config.c
@@ -292,20 +292,32 @@ static void count_peers(fastd_context *ctx, fastd_config *conf) {
conf->n_floating = 0;
conf->n_v4 = 0;
conf->n_v6 = 0;
+ conf->n_dynamic = 0;
+ conf->n_dynamic_v4 = 0;
+ conf->n_dynamic_v6 = 0;
fastd_peer_config *peer;
for (peer = conf->peers; peer; peer = peer->next) {
switch (peer->address.sa.sa_family) {
case AF_UNSPEC:
- conf->n_floating++;
+ if (peer->hostname)
+ conf->n_dynamic++;
+ else
+ conf->n_floating++;
break;
case AF_INET:
- conf->n_v4++;
+ if (peer->hostname)
+ conf->n_dynamic_v4++;
+ else
+ conf->n_v4++;
break;
case AF_INET6:
- conf->n_v6++;
+ if (peer->hostname)
+ conf->n_dynamic_v6++;
+ else
+ conf->n_v6++;
break;
default: