]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: avoid notify race between io and main pthreads
authorMark Stapp <mstapp@nvidia.com>
Thu, 8 Sep 2022 20:14:36 +0000 (16:14 -0400)
committerMark Stapp <mstapp@nvidia.com>
Thu, 8 Sep 2022 20:14:36 +0000 (16:14 -0400)
commit71ca5b09bc71e8cbe38177cf41e83fe164e52eee
tree6054107cfceedf85e87031ffb3d80c6469a0c6cf
parent6a26823c880cca9e2bd42e1660692a2bbc3c69c6
bgpd: avoid notify race between io and main pthreads

The "bgp_notify_" apis in bgp_packet.c generate a notification
to a peer, usually during error handling. The io pthread wants
to send notifications in a couple of cases during early
received-packet validation - but the existing api interacts
with the peer struct itself, and that's not safe.

Add a new api for use by the io pthread, and adjust the main
notify api so that it can avoid touching the peer struct.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
bgpd/bgp_io.c
bgpd/bgp_packet.c
bgpd/bgp_packet.h