bgpd: Use THREAD_CANCEL instead of thread_cancel

We are crashing in thread_cancel on shutdown because
the thread pointer is NULL.  Use the more appropriate
THREAD_CANCEL macro

Ticket: CM-29873
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-05-28 16:33:10 -04:00
parent c0b664a187
commit e2d409a88b

View File

@ -909,7 +909,7 @@ void bgp_close(void)
for (ALL_LIST_ELEMENTS(bm->listen_sockets, node, next, listener)) {
if (listener->bgp)
continue;
thread_cancel(listener->thread);
THREAD_OFF(listener->thread);
close(listener->fd);
listnode_delete(bm->listen_sockets, listener);
XFREE(MTYPE_BGP_LISTENER, listener->name);