From 7c5062fb275c0530559004621f7cc7e2f5d926a4 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 22 Feb 2023 11:38:00 -0500 Subject: [PATCH] bgpd: Give better debug message when configuration is being read in Sometimes bgp connections can be rejected for a variety of reasons. Give a bit more context about what is going wrong so that the operator can make better decisions about their network. Signed-off-by: Donald Sharp --- bgpd/bgp_network.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index df67e2a72..1c2e686e1 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -506,10 +506,16 @@ static void bgp_accept(struct thread *thread) * is shutdown. */ if (BGP_PEER_START_SUPPRESSED(peer1)) { - if (bgp_debug_neighbor_events(peer1)) - zlog_debug( - "[Event] Incoming BGP connection rejected from %s due to maximum-prefix or shutdown", - peer1->host); + if (bgp_debug_neighbor_events(peer1)) { + if (peer1->shut_during_cfg) + zlog_debug( + "[Event] Incoming BGP connection rejected from %s due to configuration being currently read in", + peer1->host); + else + zlog_debug( + "[Event] Incoming BGP connection rejected from %s due to maximum-prefix or shutdown", + peer1->host); + } close(bgp_sock); return; } -- 2.39.5