From fd2e2db68040223c2851394e3791c433ece7ca16 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Thu, 19 Mar 2020 17:52:10 -0400 Subject: [PATCH] bgpd: Fixed snmp and bmp 'just Established' test. It was previously comparing an fsm event variable with an fsm status constant. This fixes issue #5963. Signed-off-by: Josh Cox --- bgpd/bgp_bmp.c | 3 +-- bgpd/bgp_snmp.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 24a9cab5d1..32865da376 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -664,8 +664,7 @@ static int bmp_peer_established(struct peer *peer) return 0; /* Check if this peer just went to Established */ - if ((peer->last_major_event != OpenConfirm) || - !(peer_established(peer))) + if ((peer->ostatus != OpenConfirm) || !(peer_established(peer))) return 0; if (peer->doppelganger && (peer->doppelganger->status != Deleted)) { diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index d507161052..5cf0b73984 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -858,7 +858,7 @@ static int bgpTrapEstablished(struct peer *peer) oid index[sizeof(oid) * IN_ADDR_SIZE]; /* Check if this peer just went to Established */ - if ((peer->last_major_event != OpenConfirm) || !(peer_established(peer))) + if ((peer->ostatus != OpenConfirm) || !(peer_established(peer))) return 0; ret = inet_aton(peer->host, &addr); -- 2.39.5