From 90aa39ecefe9086300c964dc8679736cc52e768c Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 3 Oct 2023 17:46:24 +0300 Subject: [PATCH] bgpd: Add guards for zlog_debug when setting GTSM for the peer Signed-off-by: Donatas Abraitis --- bgpd/bgpd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index dbbc1fa82207..e760d4158768 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7837,8 +7837,9 @@ int peer_ttl_security_hops_set(struct peer *peer, int gtsm_hops) struct listnode *node, *nnode; int ret; - zlog_debug("%s: set gtsm_hops to %d for %s", __func__, gtsm_hops, - peer->host); + if (bgp_debug_neighbor_events(peer)) + zlog_debug("%s: set gtsm_hops to %d for %s", __func__, + gtsm_hops, peer->host); /* We cannot configure ttl-security hops when ebgp-multihop is already set. For non peer-groups, the check is simple. For peer-groups, @@ -7947,7 +7948,9 @@ int peer_ttl_security_hops_unset(struct peer *peer) struct listnode *node, *nnode; int ret = 0; - zlog_debug("%s: set gtsm_hops to zero for %s", __func__, peer->host); + if (bgp_debug_neighbor_events(peer)) + zlog_debug("%s: set gtsm_hops to zero for %s", __func__, + peer->host); /* if a peer-group member, then reset to peer-group default rather than * 0 */