summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-10-20 01:51:28 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-10-20 01:51:28 +0200
commit9f24fef5e91fb4df301242ede91ee7ac1b46b8a8 (patch)
treea7a4bd80bab46d889647aa38bc31478d6c243a53 /conf
parentf761be6b30633054a54369eee7d08b951a366e5e (diff)
Conf: Fix crash during shutdown
BIRD implements shutdown by reconfiguring to fake empty configuration. Such fake config structure is created from the last running config and shares some data, including symbol table. This allows access to (removed) routing tables and causes crash when 'show route' command is used during shutdown. Clean up symbol table, table list and links to default tables, so removed routing tables cannot be accessed during shutdown.
Diffstat (limited to 'conf')
-rw-r--r--conf/conf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/conf/conf.c b/conf/conf.c
index 58abcde1..a2b01667 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -520,6 +520,9 @@ order_shutdown(int gr)
memcpy(c, config, sizeof(struct config));
init_list(&c->protos);
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;