From 1a0a92ea3b8c1b1caf57543826c7d16fa389c418 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 25 Sep 2017 15:41:28 -0400 Subject: [PATCH 1/3] lib: Set pointer to NULL after free list_delete does not set the list pointer to NULL Thus when we accidently use it later we happily write off into lala land instead of crashing imediately Signed-off-by: Donald Sharp --- lib/thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/thread.c b/lib/thread.c index d8be32e2bd..ab785087e1 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -570,6 +570,7 @@ void thread_master_free(struct thread_master *m) close(m->io_pipe[0]); close(m->io_pipe[1]); list_delete(m->cancel_req); + m->cancel_req = NULL; hash_clean(m->cpu_record, cpu_record_hash_free); hash_free(m->cpu_record); From e5716b1677269d17a7fcd7b09a2e88f891e42018 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 25 Sep 2017 15:43:03 -0400 Subject: [PATCH 2/3] lib: Free thread_master pointer after free Signed-off-by: Donald Sharp --- lib/libfrr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libfrr.c b/lib/libfrr.c index 3e2e008223..d5078f98aa 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -886,6 +886,7 @@ void frr_fini(void) zprivs_terminate(di->privs); /* signal_init -> nothing needed */ thread_master_free(master); + master = NULL; closezlog(); /* frrmod_init -> nothing needed / hooks */ From 773829844f76f5605e7dc6490e37a674804e2400 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 25 Sep 2017 15:43:44 -0400 Subject: [PATCH 3/3] eigrpd: Follow other protocol leads and exit when told to EIGRP was continuing to run after being told to exit. Fixes:#1224 Signed-off-by: Donald Sharp --- eigrpd/eigrp_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c index 705e04b34d..c4ca07178c 100644 --- a/eigrpd/eigrp_main.c +++ b/eigrpd/eigrp_main.c @@ -100,6 +100,8 @@ static void sigint(void) { zlog_notice("Terminating on signal"); eigrp_terminate(); + + exit(0); } /* SIGUSR1 handler. */