]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Restart if route refresh is impossible on attribute change
authorMaria Matejka <mq@ucw.cz>
Wed, 4 Jun 2025 12:53:36 +0000 (14:53 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 5 Jun 2025 10:36:12 +0000 (12:36 +0200)
In previous commit, we force route refresh when some protocol attributes
change. Yet, when the neighbor doesn't support route refresh, we have to
restart the session, not send an unsupported request.

Note: if the neighbor is restarting right now with graceful restart
enabled, we keep the stale routes until the neighbor converges again.

Related to #268

proto/bgp/bgp.c

index 203715258087a54106d85eafb91dc85855798a82..d38666fab1640e33ec0e7b69b88c3bc83de22245 100644 (file)
@@ -2833,7 +2833,15 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor
       (new->cost != old->cost) ||
       (new->c.preference != old->c.preference))
   {
-    /* import_changed itself does not force ROUTE_REFRESH when import_table is active */
+    /* Route refresh needed, these attributes are set by BGP itself
+     * and even if import table exists, we can't use it */
+
+    /* Route refresh impossible, restart is needed */
+    if ((c->c.channel_state == CS_UP) && !p->route_refresh)
+      return 0;
+
+    /* Force ROUTE_REFRESH with import table; otherwise
+     * it will be forced by import_changed set to 1 later */
     if (c->c.in_table && (c->c.channel_state == CS_UP))
       bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH);