]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Fix debugs to be guarded.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 8 Apr 2017 12:55:40 +0000 (08:55 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 8 Apr 2017 12:55:40 +0000 (08:55 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/zclient.c

index 71b95ae7dbadcc8e3e4cad14b7c28ae33eb5d264..d2a518631518a14cc921e2ab72d64817098b9c4b 100644 (file)
@@ -1486,7 +1486,9 @@ lm_label_manager_connect (struct zclient *zclient)
   vrf_id_t vrf_id;
   u_int16_t cmd;
 
-  zlog_debug ("Connecting to Label Manager");
+  if (zclient_debug)
+    zlog_debug ("Connecting to Label Manager");
+
   if (zclient->sock < 0)
     return -1;
 
@@ -1518,7 +1520,8 @@ lm_label_manager_connect (struct zclient *zclient)
       zclient->sock = -1;
       return -1;
     }
-  zlog_debug ("%s: Label manager connect request (%d bytes) sent", __func__, ret);
+  if (zclient_debug)
+    zlog_debug ("%s: Label manager connect request (%d bytes) sent", __func__, ret);
 
   /* read response */
   s = zclient->ibuf;
@@ -1532,8 +1535,9 @@ lm_label_manager_connect (struct zclient *zclient)
   }
   /* result */
   result = stream_getc(s);
-  zlog_debug ("%s: Label Manager connect response (%d bytes) received, result %u",
-              __func__, size, result);
+  if (zclient_debug)
+    zlog_debug ("%s: Label Manager connect response (%d bytes) received, result %u",
+                __func__, size, result);
 
   return (int)result;
 }
@@ -1564,7 +1568,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
   u_int16_t cmd;
   u_char response_keep;
 
-  zlog_debug ("Getting Label Chunk");
+  if (zclient_debug)
+    zlog_debug ("Getting Label Chunk");
+
   if (zclient->sock < 0)
     return -1;
 
@@ -1594,7 +1600,8 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
       zclient->sock = -1;
       return -1;
     }
-  zlog_debug ("%s: Label chunk request (%d bytes) sent", __func__, ret);
+  if (zclient_debug)
+    zlog_debug ("%s: Label chunk request (%d bytes) sent", __func__, ret);
 
   /* read response */
   s = zclient->ibuf;
@@ -1606,7 +1613,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
       zlog_err ("%s: Invalid Get Label Chunk Message Reply Header", __func__);
       return -1;
   }
-  zlog_debug ("%s: Label chunk response (%d bytes) received", __func__, size);
+  if (zclient_debug)
+    zlog_debug ("%s: Label chunk response (%d bytes) received", __func__, size);
+
   /* keep */
   response_keep = stream_getc(s);
   /* start and end labels */
@@ -1627,8 +1636,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
           return -1;
   }
 
-  zlog_debug ("Label Chunk assign: %u - %u (%u) ",
-              *start, *end, response_keep);
+  if (zclient_debug)
+    zlog_debug ("Label Chunk assign: %u - %u (%u) ",
+                *start, *end, response_keep);
 
   return 0;
 }
@@ -1647,7 +1657,9 @@ lm_release_label_chunk (struct zclient *zclient, uint32_t start, uint32_t end)
   int ret;
   struct stream *s;
 
-  zlog_debug ("Releasing Label Chunk");
+  if (zclient_debug)
+    zlog_debug ("Releasing Label Chunk");
+
   if (zclient->sock < 0)
     return -1;