summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-08-01 07:49:18 -0400
committerGitHub <noreply@github.com>2022-08-01 07:49:18 -0400
commitad9b47e65eda5a0fd33e3fc874457bf1fb1ccd7e (patch)
tree88863de3217feddca1892ab28fb36504c70d771a
parent102aeba0087cea3d0bfe64beeca7af951edc14d2 (diff)
parente7e1561fbbf0d22a98677f34dd1f8a20fd6d42b5 (diff)
Merge pull request #11691 from mxyns/bmp-vpnv4monupd-fix
bgpd: fixed bmp vpnv4 monitoring sending withdraws instead of updates
-rw-r--r--bgpd/bgp_bmp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index ab557465f5..bcab4099c0 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1183,11 +1183,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;