diff options
author | mxyns <mx.yns@outlook.fr> | 2022-07-26 18:38:08 +0200 |
---|---|---|
committer | mxyns <mx.yns@outlook.fr> | 2022-07-29 20:07:21 +0200 |
commit | e7e1561fbbf0d22a98677f34dd1f8a20fd6d42b5 (patch) | |
tree | 3f2ddb3cfe4e401702733457b62b7807a1dcabe4 /bgpd/bgp_bmp.c | |
parent | Merge pull request #11627 from qlyoung/update-alpine-build (diff) | |
download | frr-e7e1561fbbf0d22a98677f34dd1f8a20fd6d42b5.tar.xz frr-e7e1561fbbf0d22a98677f34dd1f8a20fd6d42b5.zip |
bgpd: fixed bmp vpnv4 monitoring are withdraws instead of updates
fixes the recent support bmp monitor of VPNv4 afi/safi
the bmp updates messages (MP_REACH_NLRI) are never sent for VPNv4 and bmp withdraws (MP_UNREACH_NRLI) are sent instead
this is caused by bgp_node_lookup which fails to find VPNv4 bgp_node in the rib which results in NULL path info attributes passed to bmp_monitor
using bgp_afi_node_lookup instead of bgp_node_lookup solves the problem
Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
Diffstat (limited to 'bgpd/bgp_bmp.c')
-rw-r--r-- | bgpd/bgp_bmp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index e7b936233..2b6e1c8ad 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -1180,11 +1180,13 @@ static bool bmp_wrqueue(struct bmp *bmp, struct pullwr *pullwr) if (!peer_established(peer)) goto out; - bn = bgp_node_lookup(bmp->targets->bgp->rib[afi][safi], &bqe->p); - struct prefix_rd *prd = NULL; - if ((bqe->afi == AFI_L2VPN && bqe->safi == SAFI_EVPN) || - (bqe->safi == SAFI_MPLS_VPN)) - prd = &bqe->rd; + bool is_vpn = (bqe->afi == AFI_L2VPN && bqe->safi == SAFI_EVPN) || + (bqe->safi == SAFI_MPLS_VPN); + + struct prefix_rd *prd = is_vpn ? &bqe->rd : NULL; + bn = bgp_afi_node_lookup(bmp->targets->bgp->rib[afi][safi], afi, safi, + &bqe->p, prd); + if (bmp->targets->afimon[afi][safi] & BMP_MON_POSTPOLICY) { struct bgp_path_info *bpi; |