From: Maria Matejka Date: Wed, 4 Jun 2025 12:53:36 +0000 (+0200) Subject: BGP: Restart if route refresh is impossible on attribute change X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52b2312d1975bfc6ed2ab51826ac7267752e27c5;p=thirdparty%2Fbird.git BGP: Restart if route refresh is impossible on attribute change 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 --- diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 203715258..d38666fab 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -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);