summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2023-08-31 03:11:46 +0200
committerGitHub <noreply@github.com>2023-08-31 03:11:46 +0200
commit885146ea9c8f9da00bac6ea1ac04672efde890eb (patch)
tree742106e3e64c48cd2c2155ba4791fc2bc5d57b3e /bgpd/bgp_fsm.c
parentMerge pull request #14118 from GaladrielZhao/master (diff)
parentbgpd: Add peers back to peer hash when peer_xfer_conn fails (diff)
downloadfrr-885146ea9c8f9da00bac6ea1ac04672efde890eb.tar.xz
frr-885146ea9c8f9da00bac6ea1ac04672efde890eb.zip
Merge pull request #14301 from donaldsharp/bgp_lost_hash
bgpd: Add peers back to peer hash when peer_xfer_conn fails
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index b0d2a8fe0..df137b8d5 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -2146,6 +2146,17 @@ bgp_establish(struct peer_connection *connection)
peer = peer_xfer_conn(peer);
if (!peer) {
flog_err(EC_BGP_CONNECT, "%%Neighbor failed in xfer_conn");
+
+ /*
+ * A failure of peer_xfer_conn but not putting the peers
+ * back in the hash ends up with a situation where incoming
+ * connections are rejected, as that the peer is not found
+ * when a lookup is done
+ */
+ (void)hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
+ if (other)
+ (void)hash_get(other->bgp->peerhash, other,
+ hash_alloc_intern);
return BGP_FSM_FAILURE;
}