]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: On shutdown, unlock table when clearing the bgp metaQ
authorDonald Sharp <sharpd@nvidia.com>
Fri, 28 Mar 2025 18:58:01 +0000 (14:58 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Sun, 30 Mar 2025 18:02:16 +0000 (14:02 -0400)
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 <sharpd@nvidia.com>
bgpd/bgp_route.c

index 003a9a4d4d26b40049028e0a61f892801601a65a..71a1149d10afdcdbecb40288d58858585bec7d96 100644 (file)
@@ -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--;
        }
 }