]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix reconfiguration of import behavior modifiers
authorMaria Matejka <mq@ucw.cz>
Tue, 6 May 2025 17:54:11 +0000 (19:54 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 10 May 2025 14:56:27 +0000 (16:56 +0200)
In case of aigp, gw mode and cost change, we need to reload routes
from the peer, and do that forcibly even if import table is on.

proto/bgp/bgp.c

index 859f7bc167712d67c0c9fd156fe93f63f580a8a0..ec86442b219eaf918ee2f81ec54ddad76d91f40f 100644 (file)
@@ -2559,11 +2559,20 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
       (new->aigp != old->aigp) ||
       (new->cost != old->cost))
   {
-    /* If import table is active and route refresh is possible, we just ask for route refresh */
-    if ((c->c.in_keep & RIK_PREFILTER) && (c->c.channel_state == CS_UP) && p->route_refresh)
-      bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);
+    /* If import table is active we have to flush it */
+    if ((c->c.in_keep & RIK_PREFILTER) == RIK_PREFILTER)
+    {
+      if (p->route_refresh)
+      {
+       if (c->c.channel_state == CS_UP)
+         bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);
+      }
+      else
+       /* Route refresh not possible, restart needed */
+       return 0;
+    }
 
-    /* Otherwise we do complete reload */
+    /* Otherwise we just do complete reload */
     else
       *import_changed = 1;
   }