]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - conf/conf.c
Filter: Improve handling of stack frames in filter bytecode
[thirdparty/bird.git] / conf / conf.c
index b21d5213ad198a4347ce81a183cbeaf478880378..025c040e60eeeaf57ec57e1c2757b4e809c4cca4 100644 (file)
@@ -55,6 +55,7 @@
 #include "lib/timer.h"
 #include "conf/conf.h"
 #include "filter/filter.h"
+#include "sysdep/unix/unix.h"
 
 
 static jmp_buf conf_jmpbuf;
@@ -139,6 +140,7 @@ config_parse(struct config *c)
   protos_preconfig(c);
   rt_preconfig(c);
   cf_parse();
+  rt_postconfig(c);
 
   if (EMPTY_LIST(c->protos))
     cf_error("No protocol is specified in the config file");
@@ -217,6 +219,14 @@ config_del_obstacle(struct config *c)
 static int
 global_commit(struct config *new, struct config *old)
 {
+  if (!new->hostname)
+    {
+      new->hostname = get_hostname(new->mem);
+
+      if (!new->hostname)
+        log(L_WARN "Cannot determine hostname");
+    }
+
   if (!old)
     return 0;
 
@@ -511,6 +521,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;
 
@@ -573,6 +586,7 @@ cfg_copy_list(list *dest, list *src, unsigned node_size)
   {
     dn = cfg_alloc(node_size);
     memcpy(dn, sn, node_size);
+    memset(dn, 0, sizeof(node));
     add_tail(dest, dn);
   }
 }