X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet.c;h=528e046b9464a9903a79bad73aceaccc8d123cbf;hp=6ffd9989d5d4356e6e83c1e3cc08edfa20e16b08;hb=9f53ab209d8a6a7622a49ed03cef735b6e3f3eeb;hpb=d1cc637470edaed663e694fdeb290eb45cc9ecca diff --git a/src/net.c b/src/net.c index 6ffd9989..528e046b 100644 --- a/src/net.c +++ b/src/net.c @@ -489,6 +489,31 @@ int main_loop(void) { last_config_check = now; + /* If StrictSubnet is set, expire deleted Subnets and read new ones in */ + + if(strictsubnets) { + subnet_t *subnet; + + for(node = subnet_tree->head; node; node = node->next) { + subnet = node->data; + subnet->expires = 1; + } + + load_all_subnets(); + + for(node = subnet_tree->head; node; node = next) { + next = node->next; + subnet = node->data; + if(subnet->expires == 1) { + send_del_subnet(broadcast, subnet); + subnet_del(subnet->owner, subnet); + } else if(subnet->expires == -1) { + send_add_subnet(broadcast, subnet); + subnet->expires = 0; + } + } + } + /* Try to make outgoing connections */ try_outgoing_connections();