Skip to content

Commit

Permalink
bgpd: bmp_route_update, replace bgp_bmp_get with bgp_bmp_find
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 30, 2024
1 parent c2e4916 commit d5fe649
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bgpd/bgp_bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3051,11 +3051,14 @@ static int bmp_route_update(struct bgp *bgp, afi_t afi, safi_t safi,
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;
Expand Down

0 comments on commit d5fe649

Please sign in to comment.