diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-08 14:55:40 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-08 14:55:40 +0200 |
commit | 08c08a35c6552e90aafcdd857ad17e9beecac61f (patch) | |
tree | 265c4d6376c4e27b6f94f1eb4f0ea1f93d91ca99 /lib/zclient.c | |
parent | ospfd: Fix the 'show ip ospf int ...' command (diff) | |
download | frr-08c08a35c6552e90aafcdd857ad17e9beecac61f.tar.xz frr-08c08a35c6552e90aafcdd857ad17e9beecac61f.zip |
lib: Fix debugs to be guarded.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r-- | lib/zclient.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 71b95ae7d..d2a518631 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -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; |