summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-11-13 23:59:04 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-11-30 22:18:07 +0100
commit934af4587f0b7ddbfc176c3930c04cca949743ba (patch)
tree1b19c6ad23dfe27bbf5f9ecc7e03307bc94a70a6 /bgpd/bgp_packet.c
parentbgpd: yield more when generating UPDATEs (diff)
downloadfrr-934af4587f0b7ddbfc176c3930c04cca949743ba.tar.xz
frr-934af4587f0b7ddbfc176c3930c04cca949743ba.zip
bgpd: turn off keepalives when sending NOTIFY
This is necessary because otherwise between the time we wipe the output buffer and the time we push the NOTIFY onto it, the KA generation thread could have pushed a KEEPALIVE in the middle. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_packet.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index fe633413c..09df0e35b 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -58,6 +58,7 @@
#include "bgpd/bgp_updgrp.h"
#include "bgpd/bgp_label.h"
#include "bgpd/bgp_io.h"
+#include "bgpd/bgp_keepalives.h"
/**
* Sets marker and type fields for a BGP message.
@@ -655,6 +656,14 @@ void bgp_notify_send_with_data(struct peer *peer, u_char code, u_char sub_code,
/* Set BGP packet length. */
length = bgp_packet_set_size(s);
+ /*
+ * Turn off keepalive generation for peer. This is necessary because
+ * otherwise between the time we wipe the output buffer and the time we
+ * push the NOTIFY onto it, the KA generation thread could have pushed
+ * a KEEPALIVE in the middle.
+ */
+ bgp_keepalives_off(peer);
+
/* wipe output buffer */
pthread_mutex_lock(&peer->io_mtx);
{