]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Do route refresh after preference change
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 3 Jun 2025 14:56:41 +0000 (16:56 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 3 Jun 2025 14:56:41 +0000 (16:56 +0200)
Reconfiguration of preference is handled by nest code by asking for
reload, but in case of BGP with import table, that just reloaded routes
with the old preference. In BGP, we can handle that by triggering full
route refresh.

Although, it would be probably better to set preference in nest, when
a route is propagated from the import table.

proto/bgp/bgp.c

index c8f90fadb5d773b3bd8b41d32767b89f37c620e1..203715258087a54106d85eafb91dc85855798a82 100644 (file)
@@ -2830,12 +2830,16 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
   if ((new->gw_mode != old->gw_mode) ||
       (new->next_hop_prefer != old->next_hop_prefer) ||
       (new->aigp != old->aigp) ||
-      (new->cost != old->cost))
+      (new->cost != old->cost) ||
+      (new->c.preference != old->c.preference))
   {
     /* import_changed itself does not force ROUTE_REFRESH when import_table is active */
     if (c->c.in_table && (c->c.channel_state == CS_UP))
       bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);
 
+    /* Note that preference is already handled in channel_reconfigure(),
+       but we need it handle again here for the ROUTE_REFRESH trigger */
+
     *import_changed = 1;
   }