summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorBabis Chalios <mail@bchalios.io>2020-08-04 15:19:25 +0200
committerBabis Chalios <mail@bchalios.io>2020-09-02 15:30:22 +0200
commit05e68acc7598bce8859ab15581950f219c40e7dd (patch)
tree0d529d2fad74402f9a8788b5a4c79d1f2ca4d9cb /bgpd/bgp_fsm.c
parentMerge pull request #6997 from opensourcerouting/cisco-acl-name (diff)
downloadfrr-05e68acc7598bce8859ab15581950f219c40e7dd.tar.xz
frr-05e68acc7598bce8859ab15581950f219c40e7dd.zip
bgpd: fix invocation of bgpTrapBackwardTransition
The bgpTrapBackwardTransition callback was being called only during bgp_stop and only under the condition that peer status was Established. The MIB defines that the event should be generated for every transition of the BGP FSM from a higher to a lower state. Signed-off-by: Babis Chalios <mail@bchalios.io>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 28e93c409..81025543b 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1105,6 +1105,10 @@ void bgp_fsm_change_status(struct peer *peer, int status)
peer->ostatus = peer->status;
peer->status = status;
+ /* Fire backward transition hook if that's the case */
+ if (peer->ostatus > peer->status)
+ hook_call(peer_backward_transition, peer);
+
/* Save event that caused status change. */
peer->last_major_event = peer->cur_event;
@@ -1268,8 +1272,6 @@ int bgp_stop(struct peer *peer)
peer->host);
update_group_remove_peer_afs(peer);
- hook_call(peer_backward_transition, peer);
-
/* Reset peer synctime */
peer->synctime = 0;
}