From 3ffec403e87dd648c0d4cc6dbe51f9ee727ce439 Mon Sep 17 00:00:00 2001 From: vivek Date: Sun, 25 Oct 2020 20:59:58 -0700 Subject: [PATCH 1/4] bgpd: Modify keepalive debug category Log keepalive timer expiry against 'debug bgp keepalive' instead of 'debug bgp neighbor-events'. Signed-off-by: Vivek Venkatraman --- bgpd/bgp_keepalives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_keepalives.c b/bgpd/bgp_keepalives.c index 604d6c9509..b39a7daa1d 100644 --- a/bgpd/bgp_keepalives.c +++ b/bgpd/bgp_keepalives.c @@ -115,7 +115,7 @@ static void peer_process(struct hash_bucket *hb, void *arg) elapsed.tv_sec >= ka.tv_sec || timercmp(&diff, &tolerance, <); if (send_keepalive) { - if (bgp_debug_neighbor_events(pkat->peer)) + if (bgp_debug_keepalive(pkat->peer)) zlog_debug("%s [FSM] Timer (keepalive timer expire)", pkat->peer->host); From 031c24f2a96b5ec78bb6d9dccd929a3b4bfc5e4f Mon Sep 17 00:00:00 2001 From: vivek Date: Sun, 25 Oct 2020 21:05:17 -0700 Subject: [PATCH 2/4] bgpd: Add more debug info for incoming connection Signed-off-by: Vivek Venkatraman --- bgpd/bgp_network.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 9582ec01ed..b43f8c8664 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -530,8 +530,10 @@ static void bgp_accept(struct thread *thread) } if (bgp_debug_neighbor_events(peer1)) - zlog_debug("[Event] BGP connection from host %s fd %d", - inet_sutop(&su, buf), bgp_sock); + zlog_debug( + "[Event] connection from %s fd %d, active peer status %d fd %d", + inet_sutop(&su, buf), bgp_sock, peer1->status, + peer1->fd); if (peer1->doppelganger) { /* We have an existing connection. Kill the existing one and run From 9e8a096b739f1199c367867759d3fb17bc725dd6 Mon Sep 17 00:00:00 2001 From: vivek Date: Sun, 25 Oct 2020 21:44:18 -0700 Subject: [PATCH 3/4] bgpd: Remove unnecessary debug log Signed-off-by: Vivek Venkatraman --- bgpd/bgp_route.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6eb1a556b1..2ca9502545 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2653,12 +2653,7 @@ static void bgp_route_select_timer_expire(struct thread *thread) safi = info->safi; bgp = info->bgp; - if (BGP_DEBUG(update, UPDATE_OUT)) - zlog_debug("afi %d, safi %d : route select timer expired", afi, - safi); - bgp->gr_info[afi][safi].t_route_select = NULL; - XFREE(MTYPE_TMP, info); /* Best path selection */ From 71d276c88a74719552ed8b17aab66250ffec1623 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 26 Oct 2020 19:54:52 -0700 Subject: [PATCH 4/4] bgpd: Display FD in peer FSM state change log Signed-off-by: Vivek Venkatraman --- bgpd/bgp_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index f110005e49..fcb7275c34 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1335,7 +1335,7 @@ void bgp_fsm_change_status(struct peer *peer, int status) bgp_peer_update_orr_active_roots(peer); if (bgp_debug_neighbor_events(peer)) - zlog_debug("%s went from %s to %s", peer->host, + zlog_debug("%s fd %d went from %s to %s", peer->host, peer->fd, lookup_msg(bgp_status_msg, peer->ostatus, NULL), lookup_msg(bgp_status_msg, peer->status, NULL)); }