summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_io.c
diff options
context:
space:
mode:
authorNaveen Thanikachalam <nthanikachal@vmware.com>2019-02-04 15:26:01 +0100
committerIqra Siddiqui <imujeebsiddi@vmware.com>2023-06-28 09:27:44 +0200
commit7e28578bb69c0ad11c65126b984fd9a26b675956 (patch)
tree497682016175ef39447ccf5edb3105f63b72154f /bgpd/bgp_io.c
parentMerge pull request #13867 from mjstapp/fix_opq_source (diff)
downloadfrr-7e28578bb69c0ad11c65126b984fd9a26b675956.tar.xz
frr-7e28578bb69c0ad11c65126b984fd9a26b675956.zip
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 <nthanikachal@vmware.com> Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
Diffstat (limited to 'bgpd/bgp_io.c')
-rw-r--r--bgpd/bgp_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c
index 650adc1c9..e9178fd8f 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;