diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-09-20 08:47:56 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2025-01-07 15:35:31 +0100 |
commit | c032d532556ab4e1cbef9862f7eb9100dbd1126e (patch) | |
tree | 4d4032c21a109cc2b28f9ddcea8633d5b1a9506f /bgpd | |
parent | bgpd: bmp, rework the bmp_route_update() function (diff) | |
download | frr-c032d532556ab4e1cbef9862f7eb9100dbd1126e.tar.xz frr-c032d532556ab4e1cbef9862f7eb9100dbd1126e.zip |
bgpd: bmp, handle imported bgp instances for route updates
Upon route update, the list of available BGP instances that
import the BGP instance where this updates comes from, is checked.
For each eligible BGP instance, the route update is sent.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_bmp.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index d1f2083f7..91d566f3e 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -3216,6 +3216,8 @@ static int bmp_route_update(struct bgp *bgp, afi_t afi, safi_t safi, struct bmp_bgp *bmpbgp; struct bmp_targets *bt; int ret = 0; + struct bgp *bgp_vrf; + struct listnode *node; /* this should never happen */ if (!updated_route) { @@ -3223,13 +3225,18 @@ static int bmp_route_update(struct bgp *bgp, afi_t afi, safi_t safi, return 0; } - bmpbgp = bmp_bgp_find(bgp); - if (!bmpbgp) - return 0; - - frr_each (bmp_targets, &bmpbgp->targets, bt) - if (CHECK_FLAG(bt->afimon[afi][safi], BMP_MON_LOC_RIB)) + for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, bgp_vrf)) { + bmpbgp = bmp_bgp_find(bgp_vrf); + if (!bmpbgp) + continue; + frr_each (bmp_targets, &bmpbgp->targets, bt) { + if (!CHECK_FLAG(bt->afimon[afi][safi], BMP_MON_LOC_RIB)) + continue; + if (bgp_vrf != bgp && !bmp_imported_bgp_find(bt, bgp->name)) + continue; ret = bmp_route_update_bgpbmp(bt, afi, safi, bn, old_route, new_route); + } + } return ret; } |