summaryrefslogtreecommitdiff
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorbisdhdh <biswajit.sadhu@gmail.com>2019-10-24 20:29:43 +0530
committerbisdhdh <biswajit.sadhu@gmail.com>2020-01-23 09:34:25 +0530
commit9e3b51a7f3d111e6c01424dae801501f7053bc60 (patch)
tree3cb2c80f6ed3950ac2034a85a367a8125b26be23 /bgpd/bgp_fsm.c
parentd6e3c15b6294acc52ba8078000ed12dd13f25034 (diff)
bgpd: Restarting node does not send EOR after the convergence.
*After a restarting router comes up and the bgp session is successfully established with the peer. If the restarting router doesn’t have any route to send, it send EOR to the peer immediately before receiving updates from its peers. *Instead the restarting router should send EOR, if the selection deferral timer is not running OR count of eor received and eor required are matches then send EOR. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index a86c457b62..328e3a0eb0 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1197,15 +1197,20 @@ int bgp_stop(struct peer *peer)
!CHECK_FLAG(peer->af_sflags[afi][safi],
PEER_STATUS_EOR_RECEIVED)) {
gr_info = &bgp->gr_info[afi][safi];
- if (gr_info && gr_info->eor_required)
+
+ if (gr_info && (gr_info->eor_required))
gr_info->eor_required--;
- if (BGP_DEBUG(update, UPDATE_OUT))
- zlog_debug("peer %s, EOR %d",
+
+ if (gr_info && BGP_DEBUG(update,
+ UPDATE_OUT))
+ zlog_debug(
+ "peer %s, EOR %d",
peer->host,
gr_info->eor_required);
/* There is no pending EOR message */
- if (gr_info->eor_required == 0) {
+ if (gr_info && gr_info->eor_required
+ == 0) {
BGP_TIMER_OFF(
gr_info->t_select_deferral);
gr_info->eor_received = 0;
@@ -1813,7 +1818,15 @@ static int bgp_establish(struct peer *peer)
if (status < 0)
zlog_debug("Error in updating graceful restart for %s",
get_afi_safi_str(afi,
- safi, false));
+ safi, false));
+ } else {
+ if (BGP_PEER_GRACEFUL_RESTART_CAPABLE(
+ peer) &&
+ BGP_PEER_RESTARTING_MODE(peer)
+ && bgp_flag_check(peer->bgp,
+ BGP_FLAG_GR_PRESERVE_FWD))
+ peer->bgp->gr_info[afi][safi]
+ .eor_required++;
}
}
}