X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet.c;h=db8eae76e6cfab12d36fced9c28d43ad099b19de;hp=6ffd9989d5d4356e6e83c1e3cc08edfa20e16b08;hb=32f5524c4b52a2d3a96bc48ee2437f8b9b4dbe10;hpb=292354912f346fe467f557f0dc026b519997289c diff --git a/src/net.c b/src/net.c index 6ffd9989..db8eae76 100644 --- a/src/net.c +++ b/src/net.c @@ -489,6 +489,32 @@ 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) { + subnet->expires = 0; + } else { + send_add_subnet(broadcast, subnet); + } + } + } + /* Try to make outgoing connections */ try_outgoing_connections();