From: Donald Sharp Date: Fri, 28 Mar 2025 18:58:01 +0000 (-0400) Subject: bgpd: On shutdown, unlock table when clearing the bgp metaQ X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c9d431d4db48b78350d132eeea1abf839c5a3c31;p=mirror%2Ffrr.git 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 --- 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--; } }