]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Add guard for `zlog_debug` 14766/head
authorCarmine Scarpitta <cscarpit@cisco.com>
Fri, 10 Nov 2023 21:31:09 +0000 (22:31 +0100)
committerCarmine Scarpitta <cscarpit@cisco.com>
Fri, 10 Nov 2023 21:33:18 +0000 (22:33 +0100)
Add guard for `zlog_debug` when bgpd is not connected to zebra
or zebra does not know the bgp instance.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
bgpd/bgp_zebra.c

index 65ac92ef0566f077c3650796e9bfb9aa2941d77a..1e8f7415b09a7962346864cad208f2c37f8723c7 100644 (file)
@@ -73,9 +73,10 @@ static inline bool bgp_install_info_to_zebra(struct bgp *bgp)
                return false;
 
        if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
-               zlog_debug(
-                       "%s: No zebra instance to talk to, not installing information",
-                       __func__);
+               if (BGP_DEBUG(zebra, ZEBRA))
+                       zlog_debug(
+                               "%s: No zebra instance to talk to, not installing information",
+                               __func__);
                return false;
        }