From 7e28578bb69c0ad11c65126b984fd9a26b675956 Mon Sep 17 00:00:00 2001 From: Naveen Thanikachalam Date: Mon, 4 Feb 2019 06:26:01 -0800 Subject: [PATCH] bgpd: Ensure peer data structure is accessed only when BGPD is not terminating With these changes, the code ensures that the peer data-structures are accessed only after it knows that BGPD is not terminating. Authored-by: Naveen Thanikachalam Signed-off-by: Iqra Siddiqui --- bgpd/bgp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index 650adc1c9a1c..e9178fd8fccd 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -225,7 +225,7 @@ static void bgp_process_reads(struct event *thread) peer = EVENT_ARG(thread); - if (peer->fd < 0 || bm->terminating) + if (bm->terminating || peer->fd < 0) return; struct frr_pthread *fpt = bgp_pth_io;