mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 22:51:15 +00:00
bgpd: block io thread reads once shutdown has started
Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
parent
1c96f2fb96
commit
97b4a0ec78
@ -179,7 +179,7 @@ static int bgp_process_reads(struct thread *thread)
|
||||
|
||||
peer = THREAD_ARG(thread);
|
||||
|
||||
if (peer->fd < 0)
|
||||
if (peer->fd < 0 || bm->terminating)
|
||||
return -1;
|
||||
|
||||
struct frr_pthread *fpt = frr_pthread_get(PTHREAD_IO);
|
||||
|
@ -143,6 +143,8 @@ void sighup(void)
|
||||
__attribute__((__noreturn__)) void sigint(void)
|
||||
{
|
||||
zlog_notice("Terminating on signal");
|
||||
assert(bm->terminating == false);
|
||||
bm->terminating = true; /* global flag that shutting down */
|
||||
|
||||
if (!retain_mode)
|
||||
bgp_terminate();
|
||||
|
@ -7559,6 +7559,7 @@ void bgp_master_init(struct thread_master *master)
|
||||
bm->start_time = bgp_clock();
|
||||
bm->t_rmap_update = NULL;
|
||||
bm->rmap_update_timer = RMAP_DEFAULT_UPDATE_TIMER;
|
||||
bm->terminating = false;
|
||||
|
||||
bgp_process_queue_init();
|
||||
|
||||
|
@ -144,6 +144,7 @@ struct bgp_master {
|
||||
/* dynamic mpls label allocation pool */
|
||||
struct labelpool labelpool;
|
||||
|
||||
bool terminating; /* global flag that sigint terminate seen */
|
||||
QOBJ_FIELDS
|
||||
};
|
||||
DECLARE_QOBJ_TYPE(bgp_master)
|
||||
|
Loading…
Reference in New Issue
Block a user