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 <josh.cox@pureport.com>
This commit is contained in:
Josh Cox 2020-03-19 17:52:10 -04:00
parent 9c23deece2
commit fd2e2db680
2 changed files with 2 additions and 3 deletions

View File

@ -664,8 +664,7 @@ static int bmp_peer_established(struct peer *peer)
return 0; return 0;
/* Check if this peer just went to Established */ /* Check if this peer just went to Established */
if ((peer->last_major_event != OpenConfirm) || if ((peer->ostatus != OpenConfirm) || !(peer_established(peer)))
!(peer_established(peer)))
return 0; return 0;
if (peer->doppelganger && (peer->doppelganger->status != Deleted)) { if (peer->doppelganger && (peer->doppelganger->status != Deleted)) {

View File

@ -858,7 +858,7 @@ static int bgpTrapEstablished(struct peer *peer)
oid index[sizeof(oid) * IN_ADDR_SIZE]; oid index[sizeof(oid) * IN_ADDR_SIZE];
/* Check if this peer just went to Established */ /* 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; return 0;
ret = inet_aton(peer->host, &addr); ret = inet_aton(peer->host, &addr);