diff options
Diffstat (limited to 'conf/conf.c')
-rw-r--r-- | conf/conf.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/conf/conf.c b/conf/conf.c index 4e31de29..daac85c1 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -46,7 +46,7 @@ #undef LOCAL_DEBUG #include "nest/bird.h" -#include "nest/route.h" +#include "nest/rt.h" #include "nest/protocol.h" #include "nest/iface.h" #include "lib/resource.h" @@ -170,7 +170,6 @@ int cli_parse(struct config *c) { int done = 0; - c->fallback = config; new_config = c; cfg_mem = c->mem; if (setjmp(conf_jmpbuf)) @@ -181,7 +180,6 @@ cli_parse(struct config *c) done = 1; cleanup: - c->fallback = NULL; new_config = NULL; cfg_mem = NULL; return done; @@ -197,8 +195,12 @@ cleanup: void config_free(struct config *c) { - if (c) - rfree(c->pool); + if (!c) + return; + + ASSERT(!c->obstacle_count); + + rfree(c->pool); } /** @@ -207,10 +209,14 @@ config_free(struct config *c) * This function frees the old configuration (%old_config) that is saved for the * purpose of undo. It is useful before parsing a new config when reconfig is * requested, to avoid keeping three (perhaps memory-heavy) configs together. + * Configuration is not freed when it is still active during reconfiguration. */ void config_free_old(void) { + if (!old_config || old_config->obstacle_count) + return; + tm_stop(config_timer); undo_available = 0; @@ -543,7 +549,6 @@ order_shutdown(int gr) init_list(&c->tables); init_list(&c->symbols); memset(c->def_tables, 0, sizeof(c->def_tables)); - HASH_INIT(c->sym_hash, c->pool, 4); c->shutdown = 1; c->gr_down = gr; |