There is no need to create the bgp bmp instance, while there
is no bmp target to send data to.
Rewrite the code by using bgp_bmp_find() API instead.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
return 0;
}
- struct bmp_bgp *bmpbgp = bmp_bgp_get(bgp);
+ struct bmp_bgp *bmpbgp = bmp_bgp_find(bgp);
struct peer *peer = updated_route->peer;
struct bmp_targets *bt;
struct bmp *bmp;
+ if (!bmpbgp)
+ return 0;
+
frr_each (bmp_targets, &bmpbgp->targets, bt) {
if (CHECK_FLAG(bt->afimon[afi][safi], BMP_MON_LOC_RIB)) {
is_locribmon_enabled = true;