summaryrefslogtreecommitdiff
path: root/bgpd/bgp_packet.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_packet.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_packet.c')
-rw-r--r--bgpd/bgp_packet.c27
1 files changed, 24 insertions, 3 deletions
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);
+}