From 9e3b51a7f3d111e6c01424dae801501f7053bc60 Mon Sep 17 00:00:00 2001 From: bisdhdh Date: Thu, 24 Oct 2019 20:29:43 +0530 Subject: bgpd: Restarting node does not send EOR after the convergence. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *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 --- bgpd/bgp_packet.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'bgpd/bgp_packet.c') diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 88b95496e6..d6510dfaf2 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -449,14 +449,20 @@ int bgp_generate_updgrp_packets(struct thread *thread) /* If EOR is disabled, * the message is not sent */ - if (!bgp_flag_check(peer->bgp, - BGP_FLAG_GR_DISABLE_EOR - )) { + if (BGP_SEND_EOR(peer->bgp, + afi, safi)) { SET_FLAG( peer->af_sflags [afi][safi], PEER_STATUS_EOR_SEND); + /* Update EOR + * send time + */ + peer->eor_stime + [afi][safi] = + monotime(NULL); + BGP_UPDATE_EOR_PKT( peer, afi, safi, s); @@ -465,6 +471,10 @@ int bgp_generate_updgrp_packets(struct thread *thread) } continue; } + + /* Update packet send time */ + peer->pkt_stime[afi][safi] = monotime(NULL); + /* Found a packet template to send, overwrite * packet with appropriate attributes from peer * and advance peer */ @@ -2422,3 +2432,14 @@ int bgp_process_packet(struct thread *thread) return 0; } + +/* Send EOR when routes are processed by selection deferral timer */ +void bgp_send_delayed_eor(struct bgp *bgp) +{ + struct peer *peer; + struct listnode *node, *nnode; + + /* EOR message sent in bgp_write_proceed_actions */ + for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) + bgp_write_proceed_actions(peer); +} -- cgit v1.2.3