summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_conditional_adv.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-14 21:32:49 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-14 21:32:49 +0100
commitdc52beced1ef553a4f17c63859cbff0f1ea225b7 (patch)
treee8c845b5d0d0074aaa2ec38994c610abafff09a1 /bgpd/bgp_conditional_adv.c
parentMerge pull request #7474 from eololab/fix-crash-skiplist-debug (diff)
downloadfrr-dc52beced1ef553a4f17c63859cbff0f1ea225b7.tar.xz
frr-dc52beced1ef553a4f17c63859cbff0f1ea225b7.zip
bgpd: Fix missed unlocks
When iterating over the bgp_dest table, using this pattern: for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest)) { If the code breaks or returns in the middle we will not have properly unlocked the node as that bgp_table_top locks the top dest and bgp_route_next locks the next dest and unlocks the old dest. From code inspection I have found a bunch of places that we either return in the middle of or a break is issued. Add appropriate unlocks. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_conditional_adv.c')
-rw-r--r--bgpd/bgp_conditional_adv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c
index 0731adcb8..ca67d49c8 100644
--- a/bgpd/bgp_conditional_adv.c
+++ b/bgpd/bgp_conditional_adv.c
@@ -51,6 +51,7 @@ bgp_check_rmap_prefixes_in_bgp_table(struct bgp_table *table,
if (ret != RMAP_PERMITMATCH)
bgp_attr_flush(&dummy_attr);
else {
+ bgp_dest_unlock_node(dest);
if (BGP_DEBUG(update, UPDATE_OUT))
zlog_debug(
"%s: Condition map routes present in BGP table",