]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP refeed and reload with Adj-RIB-In/Out is done without route refresh
authorMaria Matejka <mq@ucw.cz>
Tue, 11 Oct 2022 17:26:31 +0000 (19:26 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 12 Oct 2022 08:05:16 +0000 (10:05 +0200)
nest/proto.c
proto/bgp/bgp.c
proto/bgp/bgp.h

index 0898dc36f15b4c2e4144fc8a23a67a7e96d15b1e..e39fbdfe114f56e8ecf0a94a2373f2d59f9f2d8f 100644 (file)
@@ -661,6 +661,7 @@ channel_schedule_reload(struct channel *c)
 {
   ASSERT(c->in_req.hook);
 
+  rt_refresh_begin(&c->in_req);
   rt_request_export(c->table, &c->reload_req);
 }
 
@@ -677,8 +678,13 @@ channel_reload_stopped(struct rt_export_request *req)
 static void
 channel_reload_log_state_change(struct rt_export_request *req, u8 state)
 {
+  struct channel *c = SKIP_BACK(struct channel, reload_req, req);
+
   if (state == TES_READY)
+  {
+    rt_refresh_end(&c->in_req);
     rt_stop_export(req, channel_reload_stopped);
+  }
 }
 
 static void
index 1755c5e4b892df5aa77d778e8ac75192e8927b7d..8bacebfc278a547a7f97dd53e699f3c03a6f9d3c 100644 (file)
@@ -1464,6 +1464,12 @@ bgp_feed_begin(struct channel *C, int initial)
   if (initial && p->cf->gr_mode)
     c->feed_state = BFS_LOADING;
 
+  if (!initial && C->out_table)
+  {
+    c->feed_out_table = 1;
+    return;
+  }
+
   /* It is refeed and both sides support enhanced route refresh */
   if (!initial && p->enhanced_refresh)
   {
@@ -1482,6 +1488,12 @@ bgp_feed_end(struct channel *C)
   struct bgp_proto *p = (void *) C->proto;
   struct bgp_channel *c = (void *) C;
 
+  if (c->feed_out_table)
+  {
+    c->feed_out_table = 0;
+    return;
+  }
+
   /* This should not happen */
   if (!p->conn)
     return;
index 1bcfb915c5502727f1892e4724d02772927fb3f1..b76ffe99ae7cbb6a2d7a359d39bb30c93dee26ff 100644 (file)
@@ -383,6 +383,8 @@ struct bgp_channel {
 
   u8 feed_state;                       /* Feed state (TX) for EoR, RR packets, see BFS_* */
   u8 load_state;                       /* Load state (RX) for EoR, RR packets, see BFS_* */
+
+  u8 feed_out_table;                   /* Refeed into out_table */
 };
 
 struct bgp_prefix {