From a70a6da3e43faac70036fb4539d53550f23d13b3 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 12 Feb 2025 21:29:10 +0100 Subject: [PATCH] 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. --- proto/bgp/attrs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index db6542343..01bc88340 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); -- 2.47.2