]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Conf: Fix crash during shutdown
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 19 Oct 2021 23:51:28 +0000 (01:51 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 19 Oct 2021 23:51:28 +0000 (01:51 +0200)
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.

conf/conf.c

index 58abcde13dd42f6c05902c3736374a9b338cbcf6..a2b016672f2cd69b6dcd559afd1e465859779d33 100644 (file)
@@ -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;