summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_bmp.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-07-27 13:51:15 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-07-28 13:36:38 +0200
commita25ae82fd4d419b9bf22ba26f0dcad91f349a578 (patch)
tree0534dfe09a8f75e2bccd1ca2a050063d17f7fdd6 /bgpd/bgp_bmp.c
parentMerge pull request #11701 from kuldeepkash/pim_v6 (diff)
downloadfrr-a25ae82fd4d419b9bf22ba26f0dcad91f349a578.tar.xz
frr-a25ae82fd4d419b9bf22ba26f0dcad91f349a578.zip
bgpd: Unlock bgp_node after bgp_node_lookup
bgp_node_lookup increments lock, we should decrement it after use. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_bmp.c')
-rw-r--r--bgpd/bgp_bmp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index cf196f739..ab557465f 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -992,7 +992,7 @@ afibreak:
}
struct bgp_table *table = bmp->targets->bgp->rib[afi][safi];
- struct bgp_dest *bn;
+ struct bgp_dest *bn = NULL;
struct bgp_path_info *bpi = NULL, *bpiter;
struct bgp_adj_in *adjin = NULL, *adjiter;
@@ -1120,6 +1120,9 @@ afibreak:
bmp_monitor(bmp, adjin->peer, 0, bn_p, prd, adjin->attr, afi,
safi, adjin->uptime);
+ if (bn)
+ bgp_dest_unlock_node(bn);
+
return true;
}
@@ -1145,7 +1148,7 @@ static bool bmp_wrqueue(struct bmp *bmp, struct pullwr *pullwr)
{
struct bmp_queue_entry *bqe;
struct peer *peer;
- struct bgp_dest *bn;
+ struct bgp_dest *bn = NULL;
bool written = false;
bqe = bmp_pull(bmp);
@@ -1220,6 +1223,10 @@ static bool bmp_wrqueue(struct bmp *bmp, struct pullwr *pullwr)
out:
if (!bqe->refcount)
XFREE(MTYPE_BMP_QUEUE, bqe);
+
+ if (bn)
+ bgp_dest_unlock_node(bn);
+
return written;
}