0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

BGP: fix listen socket cleanup

This commit is contained in:
Maria Matejka 2023-05-08 18:57:32 +02:00
parent 2623b7ba5d
commit 794f555f63

View File

@ -197,14 +197,21 @@ bgp_close(struct bgp_proto *p)
struct bgp_listen_request *req = &p->listen;
struct bgp_socket *bs = req->sock;
if (bs)
if (enlisted(&req->n))
{
req->sock = NULL;
/* Remove listen request from listen socket or pending list */
rem_node(&req->n);
if (bs)
{
/* Already had a socket. */
req->sock = NULL;
/* Request listen socket cleanup */
if (bs && EMPTY_LIST(bs->requests))
ev_send(&global_event_list, &bgp_listen_event);
}
}
UNLOCK_DOMAIN(rtable, bgp_listen_domain);
}