From: Maria Matejka Date: Tue, 6 May 2025 17:54:11 +0000 (+0200) Subject: BGP: Fix reconfiguration of import behavior modifiers X-Git-Tag: v3.0.3~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b307b538ea71fc36f8b7e3766e744177ef97a466;p=thirdparty%2Fbird.git BGP: Fix reconfiguration of import behavior modifiers 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. --- diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 859f7bc16..ec86442b2 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -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; }