From: Maxou Date: Fri, 12 Aug 2022 14:45:05 +0000 (+0200) Subject: bgpd: bmp locrib monitoring unlock node after lookup X-Git-Tag: base_10.0~282^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=19b3ead3f0397bc00725145c2cb4a5bea74e5a74;p=mirror%2Ffrr.git bgpd: bmp locrib monitoring unlock node after lookup bgp_afi_node_lookup calls bgp_node_lookup which locks the node, unlocking it safely after function is finished Signed-off-by: Maxence Younsi --- diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 820720df55..f52c069f3c 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -1213,7 +1213,7 @@ static inline struct bmp_queue_entry *bmp_pull_locrib(struct bmp *bmp) &bmp->locrib_queuepos); } -/* TODO BMP_MON_LOCRIB find a way to merge properly this function with +/* TODO BMP_MON_LOCRIB find a way to merge properly this function with * bmp_wrqueue or abstract it if possible */ static bool bmp_wrqueue_locrib(struct bmp *bmp, struct pullwr *pullwr) @@ -1221,7 +1221,7 @@ static bool bmp_wrqueue_locrib(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_locrib(bmp); @@ -1274,10 +1274,6 @@ static bool bmp_wrqueue_locrib(struct bmp *bmp, struct pullwr *pullwr) &bqe->p, prd); struct bgp_path_info *bpi; - - struct bgp_path_info *pathinfo = NULL; - pathinfo = bgp_dest_get_bgp_path_info(bn); - for (bpi = bn ? bgp_dest_get_bgp_path_info(bn) : NULL; bpi; bpi = bpi->next) { if (!CHECK_FLAG(bpi->flags, BGP_PATH_SELECTED)) @@ -1294,6 +1290,10 @@ static bool bmp_wrqueue_locrib(struct bmp *bmp, struct pullwr *pullwr) out: if (!bqe->refcount) XFREE(MTYPE_BMP_QUEUE, bqe); + + if (bn) + bgp_dest_unlock_node(bn); + return written; }