#include "nest/route.h"
#include "nest/protocol.h"
#include "nest/iface.h"
+#include "nest/mpls.h"
#include "lib/resource.h"
#include "lib/string.h"
#include "lib/event.h"
cf_lex_init(0, c);
sysdep_preconfig(c);
protos_preconfig(c);
+ mpls_preconfig(c);
rt_preconfig(c);
cf_parse();
rt_postconfig(c);
cli_parse(struct config *c)
{
int done = 0;
- c->fallback = config;
new_config = c;
cfg_mem = c->mem;
if (setjmp(conf_jmpbuf))
done = 1;
cleanup:
- c->fallback = NULL;
new_config = NULL;
cfg_mem = NULL;
return done;
void
config_free(struct config *c)
{
- if (c)
- rfree(c->pool);
+ if (!c)
+ return;
+
+ ASSERT(!c->obstacle_count);
+
+ rfree(c->pool);
}
/**
* 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;
int force_restart = sysdep_commit(c, old_config);
DBG("global_commit\n");
force_restart |= global_commit(c, old_config);
+ mpls_commit(c, old_config);
DBG("rt_commit\n");
rt_commit(c, old_config);
DBG("protos_commit\n");
memcpy(c, config, sizeof(struct config));
init_list(&c->protos);
init_list(&c->tables);
+ init_list(&c->mpls_domains);
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;