]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Ensure peer data structure is accessed only when BGPD is not terminating
authorNaveen Thanikachalam <nthanikachal@vmware.com>
Mon, 4 Feb 2019 14:26:01 +0000 (06:26 -0800)
committerIqra Siddiqui <imujeebsiddi@vmware.com>
Wed, 28 Jun 2023 07:27:44 +0000 (00:27 -0700)
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>
bgpd/bgp_io.c

index 650adc1c9a1c4c59add95cc7dc87d17bdaea486f..e9178fd8fccda37974f6fb002c086854e478dec6 100644 (file)
@@ -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;