]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
fixup! fixup! fixup! fixup! fixup! partial import seems working
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Thu, 2 Nov 2023 09:04:35 +0000 (10:04 +0100)
committerKaterina Kubecova <katerina.kubecova@nic.cz>
Thu, 2 Nov 2023 09:04:35 +0000 (10:04 +0100)
nest/config.Y
proto/bgp/bgp.c
proto/ospf/ospf.c
proto/pipe/pipe.c
proto/rip/rip.c
proto/static/static.c

index 0b86f6865a278e3116bb58f25e31d0d12c9f823b..f871ac2a5c51864f7d582cd62045dcfd734b210d 100644 (file)
@@ -128,7 +128,8 @@ proto_call_cmd_reload(struct proto_spec ps, int dir, const struct f_trie *trie)
   if (trie)
   {
     /* CLI linpool is moved to trie, because trie is need for longer time
-    than the linpool would exist in CLI. The linpool is freed in channel_reload_out_done_main */
+     * than the linpool would exist in CLI. The linpool is freed in channel_reload_out_done_main.
+     */
     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);
index 58d87e1a6bc5c10e7099af744584bea58f0a4d78..bac1af3af24c4a83ed4f03fc428c0b178df2f1c8 100644 (file)
@@ -1569,21 +1569,17 @@ bgp_reload_routes(struct channel *C, struct channel_import_request *cir)
   /* Ignore non-BGP channels */
   if (C->class != &channel_bgp)
   {
-    if (cir)
-      cir->done(cir);
+    cir->done(cir);
     return 1;
   }
 
-  if (cir)
+  if (cir->trie)
   {
-    if (cir->trie)
-    {
-      cir->done(cir);
-      return 0;
-    }
-    /* We do not need cir anymore and later we will not be able to detect when to free it. */
     cir->done(cir);
+    return 0;
   }
+  /* We do not need cir anymore and later we will not be able to detect when to free it. */
+  cir->done(cir);
 
   ASSERT(p->conn && p->route_refresh);
   bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);
index 47c5303ba734cd04fc21b6e574b5a2b6b32958eb..c1635afc66081f3d62d1ad7b27a871469a4c4ed0 100644 (file)
@@ -436,10 +436,9 @@ static int
 ospf_reload_routes(struct channel *C, struct channel_import_request *cir)
 {
   struct ospf_proto *p = (struct ospf_proto *) C->proto;
-  if (cir) {
-    cir->next = p->cir;
-    p->cir = cir;
-  }
+  cir->next = p->cir;
+  p->cir = cir;
+
   if (p->calcrt == 2)
     return 1;
 
index c2cfa5a180e71880ead6569f0b3975da76acb717..c473d76d3d184e1043bda30befbf874261b090c3 100644 (file)
@@ -121,8 +121,7 @@ pipe_reload_routes(struct channel *C, struct channel_import_request *cir)
     channel_request_feeding((C == p->pri) ? p->sec : p->pri, &reload->cfr);
   }
   else{
-    if(cir)
-      cir->done(cir);
+    cir->done(cir);
     /* Route reload on one channel is just refeed on the other */
     channel_request_feeding_dynamic((C == p->pri) ? p->sec : p->pri, CFRT_DIRECT);
   }
index 0325a66097001acea0c105c95c666e7489628f81..50a0751448dc9a9fcd522019d7659d66c5c8ce97 100644 (file)
@@ -1166,10 +1166,10 @@ static int
 rip_reload_routes(struct channel *C, struct channel_import_request *cir)
 {
   struct rip_proto *p = (struct rip_proto *) C->proto;
-  if (cir) {
-    cir->next = p->cir;
-    p->cir = cir;
-  }
+
+  cir->next = p->cir;
+  p->cir = cir;
+
   if (p->rt_reload)
     return 1;
 
index 82ab580d53f872c9a301ecec624eeac8fc2c6337..c31b6268c15e5af44b7017a65589295a88b00fb9 100644 (file)
@@ -421,14 +421,11 @@ static_reload_routes(struct channel *C, struct channel_import_request *cir)
 
   TRACE(D_EVENTS, "Scheduling route reload");
 
-  if (cir && cir->trie)
+  if (cir->trie)
     static_mark_partial(p, cir);
   else
-  {
-    if (cir)
-      cir->done(cir);
     static_mark_all(p);
-  }
+
   return 1;
 }