From c9d431d4db48b78350d132eeea1abf839c5a3c31 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 28 Mar 2025 14:58:01 -0400 Subject: [PATCH] bgpd: On shutdown, unlock table when clearing the bgp metaQ There are some tables not being freed upon shutdown. This is happening because the table is being locked as dests are being put on the metaQ. When in shutdown it was clearing the MetaQ it was not unlocking the table Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 003a9a4d4d..71a1149d10 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4323,9 +4323,14 @@ static void early_meta_queue_free(struct meta_queue *mq, struct bgp_dest_queue * struct bgp_dest *dest; while (!STAILQ_EMPTY(l)) { + struct bgp_table *table; + dest = STAILQ_FIRST(l); STAILQ_REMOVE_HEAD(l, pq); STAILQ_NEXT(dest, pq) = NULL; /* complete unlink */ + + table = bgp_dest_table(dest); + bgp_table_unlock(table); mq->size--; } } @@ -4336,9 +4341,14 @@ static void other_meta_queue_free(struct meta_queue *mq, struct bgp_dest_queue * struct bgp_dest *dest; while (!STAILQ_EMPTY(l)) { + struct bgp_table *table; + dest = STAILQ_FIRST(l); STAILQ_REMOVE_HEAD(l, pq); STAILQ_NEXT(dest, pq) = NULL; /* complete unlink */ + + table = bgp_dest_table(dest); + bgp_table_unlock(table); mq->size--; } } -- 2.39.5