summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-04-22 07:41:08 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-04-22 12:32:47 -0400
commit588e90ecde9a00ca200ef636811327dc2b2c004f (patch)
tree2d53274eaa1874baeb3fd59154140e00c3da883c /lib/bfd.c
parent7709d56bc90a9b7419d389fbf6b291e055f87fb9 (diff)
lib: bfd debug fixup
BFD debugs were being output without any debug protection. Modify the code to not output unless debugging is turned on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index ddf03d4f1c..d48dc651c6 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -33,6 +33,8 @@
#include "vty.h"
#include "bfd.h"
+int bfd_debug = 0;
+
/*
* bfd_info_create - Allocate the BFD information
*/
@@ -130,8 +132,9 @@ bfd_peer_sendmsg (struct zclient *zclient, struct bfd_info *bfd_info,
/* Check socket. */
if (!zclient || zclient->sock < 0)
{
- zlog_debug("%s: Can't send BFD peer register, Zebra client not "
- "established", __FUNCTION__);
+ if (bfd_debug)
+ zlog_debug("%s: Can't send BFD peer register, Zebra client not "
+ "established", __FUNCTION__);
return;
}
@@ -214,7 +217,8 @@ bfd_peer_sendmsg (struct zclient *zclient, struct bfd_info *bfd_info,
if (ret < 0)
{
- zlog_warn("bfd_peer_sendmsg: zclient_send_message() failed");
+ if (bfd_debug)
+ zlog_debug("bfd_peer_sendmsg: zclient_send_message() failed");
return;
}
@@ -269,8 +273,9 @@ bfd_get_peer_info (struct stream *s, struct prefix *dp, struct prefix *sp,
ifp = if_lookup_by_index_vrf (ifindex, vrf_id);
if (ifp == NULL)
{
- zlog_warn ("zebra_interface_bfd_read: "
- "Can't find interface by ifindex: %d ", ifindex);
+ if (bfd_debug)
+ zlog_debug ("zebra_interface_bfd_read: "
+ "Can't find interface by ifindex: %d ", ifindex);
return NULL;
}
}
@@ -453,8 +458,9 @@ bfd_client_sendmsg (struct zclient *zclient, int command)
/* Check socket. */
if (!zclient || zclient->sock < 0)
{
- zlog_debug("%s: Can't send BFD client register, Zebra client not "
- "established", __FUNCTION__);
+ if (bfd_debug)
+ zlog_debug ("%s: Can't send BFD client register, Zebra client not "
+ "established", __FUNCTION__);
return;
}
@@ -470,8 +476,9 @@ bfd_client_sendmsg (struct zclient *zclient, int command)
if (ret < 0)
{
- zlog_warn("bfd_client_sendmsg %d: zclient_send_message() failed",
- getpid());
+ if (bfd_debug)
+ zlog_debug ("bfd_client_sendmsg %d: zclient_send_message() failed",
+ getpid());
return;
}