/* placeholder bucket data to use for fast key lookups */
static struct pkat holder = {0};
+ if (!peerhash_mtx) {
+ zlog_warn("%s: call bgp_keepalives_init() first", __func__);
+ return;
+ }
+
pthread_mutex_lock(peerhash_mtx);
{
holder.peer = peer;
/* placeholder bucket data to use for fast key lookups */
static struct pkat holder = {0};
+ if (!peerhash_mtx) {
+ zlog_warn("%s: call bgp_keepalives_init() first", __func__);
+ return;
+ }
+
pthread_mutex_lock(peerhash_mtx);
{
holder.peer = peer;
#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.
/* 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);
{