X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=ab4b635b0444985092db12edd69bd7b5b3912029;hb=7e09765003114ba37fed2851d9126924d0f813f1;hp=22c9d3727f70b43c89241e2c4a1806a091d23d14;hpb=f1baecb98b5cd78356acc590cea9c79d36d81be3;p=tinc diff --git a/src/net.c b/src/net.c index 22c9d372..ab4b635b 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* net.c -- most of the network code Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2017 Guus Sliepen + 2000-2021 Guus Sliepen 2006 Scott Lamb 2011 Loïc Grenié @@ -404,21 +404,18 @@ int reload_configuration(void) { while(cfg) { subnet_t *subnet, *s2; - if(!get_config_subnet(cfg, &subnet)) { - cfg = lookup_config_next(config_tree, cfg); - continue; - } + if(get_config_subnet(cfg, &subnet)) { + if((s2 = lookup_subnet(myself, subnet))) { + if(s2->expires == 1) { + s2->expires = 0; + } - if((s2 = lookup_subnet(myself, subnet))) { - if(s2->expires == 1) { - s2->expires = 0; + free_subnet(subnet); + } else { + subnet_add(myself, subnet); + send_add_subnet(everyone, subnet); + subnet_update(myself, subnet, true); } - - free_subnet(subnet); - } else { - subnet_add(myself, subnet); - send_add_subnet(everyone, subnet); - subnet_update(myself, subnet, true); } cfg = lookup_config_next(config_tree, cfg);