From: Maria Matejka Date: Wed, 12 Feb 2025 20:29:10 +0000 (+0100) Subject: BGP export table src fix X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0abdc2b2a66a2c304387eab825a7d21e31689019;p=thirdparty%2Fbird.git BGP export table src fix When exchanging routes in BGP export table, we forgot to update the src in cases of add path off. This led to falsely claiming another origin of that route in export table dump and also holding protocols in the flush state because of their srcs being kept in the export tables. --- diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index b986ac8b8..7ef81c38f 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1843,7 +1843,17 @@ bgp_get_prefix(struct bgp_ptx_private *c, struct netindex *ni, struct rte_src *s /* Find existing */ struct bgp_prefix *px = bgp_find_prefix(c, ni, src, add_path_tx); if (px) + { + /* If sending only best path, we have to exchange the stored src */ + if (px->src != src) + { + rt_unlock_source(px->src); + rt_lock_source(src); + px->src = src; + } + return px; + } /* Allocate new prefix */ px = sl_alloc(c->prefix_slab);