]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
fixup! partial reload for RPKI - not working
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Tue, 24 Oct 2023 10:00:03 +0000 (12:00 +0200)
committerKaterina Kubecova <katerina.kubecova@nic.cz>
Tue, 24 Oct 2023 10:00:03 +0000 (12:00 +0200)
nest/config.Y
nest/proto.c
sysdep/unix/krt.c

index e0329d400f2db0167d3634ff91450877bb125c6d..bb1b6f33571abdd7a064904b6b291dee0b74af5a 100644 (file)
@@ -110,13 +110,28 @@ proto_postconfig(void)
 static inline void
 proto_call_cmd_reload(struct proto_spec ps, int dir, const struct f_trie *trie)
 {
+  log("Start of cmd reload");
   struct proto_reload_request *prr = cfg_alloc(sizeof *prr);
   *prr = (struct proto_reload_request) {
     .trie = trie,
     .dir = dir,
+    .counter =1,
   };
+  if (trie)
+  {
+    ASSERT_DIE(this_cli->parser_pool == prr->trie->lp);
+    rmove(this_cli->parser_pool, &root_pool);
+    this_cli->parser_pool = lp_new(this_cli->pool);
+    prr->ev = (event) {
+      .data = prr,
+    };
+  }
 
   proto_apply_cmd(ps, proto_cmd_reload, 1, (uintptr_t) prr);
+  if (trie)
+    if (atomic_fetch_sub_explicit(&prr->counter, 1, memory_order_acq_rel) == 1)
+      ev_send_loop(&main_birdloop, &prr->ev);
 }
 
 #define DIRECT_CFG ((struct rt_dev_config *) this_proto)
index 728c0e54949b059d3a4ae94670f1e30ae52d3f1c..f61a49e8f65ad963b124bb008a198569027db3f5 100644 (file)
@@ -361,6 +361,7 @@ channel_roa_in_reload_done(struct channel_import_request *req)
 static void
 channel_roa_in_changed(struct settle *se)
 {
+  log("channel_roa in changed");
   struct roa_subscription *s = SKIP_BACK(struct roa_subscription, settle, se);
   struct channel *c = s->c;
 
@@ -2807,6 +2808,9 @@ void
 proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
 {
   struct proto_reload_request *prr = (void *) _prr;
+  
+  if (prr->trie)
+    prr->ev.hook = channel_reload_out_done_main;
   struct channel *c;
   log("channel proto_cmd_reload_called");
 
@@ -2830,15 +2834,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
       }
 
   log(L_INFO "Reloading protocol %s", p->name);
-  
-  ASSERT_DIE(this_cli->parser_pool == prr->trie->lp);
-  rmove(this_cli->parser_pool, &root_pool);
-  this_cli->parser_pool = lp_new(this_cli->pool);
-  prr->ev = (event) {
-      .hook = channel_reload_out_done_main,
-      .data = prr,
-  };
-  prr->counter = 1;
 
   /* re-importing routes */
   if (prr->dir != CMD_RELOAD_OUT)
@@ -2893,8 +2888,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
          channel_request_feeding_dynamic(c, CFRT_AUXILIARY);
 
   cli_msg(-15, "%s: reloading", p->name);
-  if (atomic_fetch_sub_explicit(&prr->counter, 1, memory_order_acq_rel) == 1)
-    ev_send_loop(&main_birdloop, &prr->ev);
 }
 
 extern void pipe_update_debug(struct proto *P);
index bb638a70b4525dd64e395ad39667f2ebe5876a5e..a216dbc3e63e9e97658bff53a832eb59ad4e5f73 100644 (file)
@@ -766,8 +766,8 @@ krt_if_notify(struct proto *P, uint flags, struct iface *iface UNUSED)
     krt_scan_timer_kick(p);
 }
 
-static void
-krt_reload_routes(struct channel *C)
+static int
+krt_reload_routes(struct channel *C, struct channel_import_request *UNUSED)
 {
   struct krt_proto *p = (void *) C->proto;
 
@@ -778,6 +778,7 @@ krt_reload_routes(struct channel *C)
     p->reload = 1;
     krt_scan_timer_kick(p);
   }
+  return 1;
 }
 
 static void krt_cleanup(struct krt_proto *p);