From 53aabbe1924b60fda0d5a852edd880c7b64da3de Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 23 Apr 2021 23:50:31 -0400 Subject: [PATCH] bgpd: Prevent race condition loss of config If we have a situation where BGP is partially reading in a config file for a neighbor, *and* the neighbor is coming up *and* we have a doppelganger. There exists a race condition when we transfer the config from the doppelganger to the config peer that we will overwrite later config because we are copying the config data from the doppelganger peer( which was captured at the start of initiation of the peering ). From what I can tell the peer->af_flags variable is to hold configuration flags for the local peer. The doppelganger should never overwrite this. Signed-off-by: Donald Sharp --- bgpd/bgp_fsm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 88c44fc984..6bcb31e652 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -294,7 +294,6 @@ static struct peer *peer_xfer_conn(struct peer *from_peer) } FOREACH_AFI_SAFI (afi, safi) { - peer->af_flags[afi][safi] = from_peer->af_flags[afi][safi]; peer->af_sflags[afi][safi] = from_peer->af_sflags[afi][safi]; peer->af_cap[afi][safi] = from_peer->af_cap[afi][safi]; peer->afc_nego[afi][safi] = from_peer->afc_nego[afi][safi];