From b307b538ea71fc36f8b7e3766e744177ef97a466 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 6 May 2025 19:54:11 +0200 Subject: [PATCH] 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. --- proto/bgp/bgp.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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; } -- 2.47.2