In bgp_keepalives.c, it was noticed that we were
ensuring that we called an intialization function first,
but this is a development escape in that once this
was fixed we never see it. So if a developer moves
this assumption around, let's crash the program and
lead them to this spot instead of silently ignoring
the problem.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
/* 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;
- }
+ /*
+ * We need to ensure that bgp_keepalives_init was called first
+ */
+ assert(peerhash_mtx);
pthread_mutex_lock(peerhash_mtx);
{
/* 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;
- }
+ /*
+ * We need to ensure that bgp_keepalives_init was called first
+ */
+ assert(peerhash_mtx);
pthread_mutex_lock(peerhash_mtx);
{