0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +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,13 +197,20 @@ bgp_close(struct bgp_proto *p)
struct bgp_listen_request *req = &p->listen; struct bgp_listen_request *req = &p->listen;
struct bgp_socket *bs = req->sock; 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); rem_node(&req->n);
if (bs && EMPTY_LIST(bs->requests)) if (bs)
ev_send(&global_event_list, &bgp_listen_event); {
/* 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); UNLOCK_DOMAIN(rtable, bgp_listen_domain);