From: Pavel Tvrdik Date: Mon, 2 May 2016 12:00:21 +0000 (+0200) Subject: Merge branch 'master' into mrtdump X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dea356ac9296d5164d411d97548b3f3285bcbd2;p=thirdparty%2Fbird.git Merge branch 'master' into mrtdump --- 1dea356ac9296d5164d411d97548b3f3285bcbd2 diff --cc conf/conf.c index 02494d810,825a8e9f1..3bae7feae --- a/conf/conf.c +++ b/conf/conf.c @@@ -92,10 -91,15 +92,15 @@@ config_alloc(byte *name linpool *l = lp_new(p, 4080); struct config *c = lp_allocz(l, sizeof(struct config)); + /* Duplication of name string in local linear pool */ + uint nlen = strlen(name) + 1; + char *ndup = lp_allocu(l, nlen); + memcpy(ndup, name, nlen); + - c->mrtdump_file = -1; /* Hack, this should be sysdep-specific */ + 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}; diff --cc nest/route.h index 9ea956337,9368808fb..04f647a6e --- a/nest/route.h +++ b/nest/route.h @@@ -70,11 -70,13 +70,13 @@@ void *fib_get(struct fib *, ip_addr *, 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; \ diff --cc nest/rt-table.c index 9550dd3f4,57c8b8e08..696a3d6d5 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@@ -1882,7 -1862,7 +1876,8 @@@ rt_unlock_table(rtable *r { 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); @@@ -1916,10 -1896,9 +1911,10 @@@ rt_commit(struct config *new, struct co 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);