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:
parent
2623b7ba5d
commit
794f555f63
@ -197,14 +197,21 @@ 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)
|
||||||
|
{
|
||||||
|
/* Already had a socket. */
|
||||||
|
req->sock = NULL;
|
||||||
|
|
||||||
|
/* Request listen socket cleanup */
|
||||||
if (bs && EMPTY_LIST(bs->requests))
|
if (bs && EMPTY_LIST(bs->requests))
|
||||||
ev_send(&global_event_list, &bgp_listen_event);
|
ev_send(&global_event_list, &bgp_listen_event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UNLOCK_DOMAIN(rtable, bgp_listen_domain);
|
UNLOCK_DOMAIN(rtable, bgp_listen_domain);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user