linpool *l = lp_new(p, 4080);
struct config *c = lp_allocz(l, sizeof(struct config));
- c->mrtdump_file = -1; /* Hack, this should be sysdep-specific */
+ /* Duplication of name string in local linear pool */
+ uint nlen = strlen(name) + 1;
+ char *ndup = lp_allocu(l, nlen);
+ memcpy(ndup, name, nlen);
+
+ c->mrt_proto_file = -1; /* Indication that the file descriptor should not be used */
c->pool = p;
- cfg_mem = c->mem = l;
- c->file_name = cfg_strdup(name);
+ c->mem = l;
+ c->file_name = ndup;
c->load_time = now;
c->tf_route = c->tf_proto = (struct timeformat){"%T", "%F", 20*3600};
c->tf_base = c->tf_log = (struct timeformat){"%F %T", NULL, 0};
void *fib_route(struct fib *, ip_addr, int); /* Longest-match routing lookup */
void fib_delete(struct fib *, void *); /* Remove fib entry */
void fib_free(struct fib *); /* Destroy the fib */
-void fib_check(struct fib *); /* Consistency check for debugging */
+void fib_check(const struct fib *); /* Consistency check for debugging */
-void fit_init(struct fib_iterator *, struct fib *); /* Internal functions, don't call */
-struct fib_node *fit_get(struct fib *, struct fib_iterator *);
+void fit_init(struct fib_iterator *, const struct fib *); /* Internal functions, don't call */
+struct fib_node *fit_get(const struct fib *, struct fib_iterator *);
void fit_put(struct fib_iterator *, struct fib_node *);
+ void fit_put_next(struct fib *f, struct fib_iterator *i, struct fib_node *n, uint hpos);
+
#define FIB_WALK(fib, z) do { \
struct fib_node *z, **ff = (fib)->hash_table; \
{
struct config *conf = r->deleted;
DBG("Deleting routing table %s\n", r->name);
+
+ r->config->table = NULL;
if (r->hostcache)
rt_free_hostcache(r);
rem_node(&r->n);
WALK_LIST(o, old->tables)
{
rtable *ot = o->table;
+ mrt_table_dump_stop_periodic(ot);
if (!ot->deleted)
{
- struct symbol *sym = cf_find_symbol(o->name);
+ struct symbol *sym = cf_find_symbol(new, o->name);
if (sym && sym->class == SYM_TABLE && !new->shutdown)
{
DBG("\t%s: same\n", o->name);