From bd7d02999f1d1c2a4aaa484c24738d31f80aab82 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 7 Jul 2017 09:45:15 -0400 Subject: [PATCH] zebra: Guard debugs in interface speed check Not being able to get the interface speed is a common occurrence for some interface types. Convert this these outputs to a guarded debug. Signed-off-by: Donald Sharp --- zebra/if_netlink.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 8064071c37..0d08155178 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -403,16 +403,19 @@ static int get_iflink_speed(const char *ifname) /* use ioctl to get IP address of an interface */ sd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); if (sd < 0) { - zlog_debug("Failure to read interface %s speed: %d %s", ifname, - errno, safe_strerror(errno)); + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("Failure to read interface %s speed: %d %s", + ifname, errno, safe_strerror(errno)); return 0; } /* Get the current link state for the interface */ rc = ioctl(sd, SIOCETHTOOL, (char *)&ifdata); if (rc < 0) { - zlog_debug("IOCTL failure to read interface %s speed: %d %s", - ifname, errno, safe_strerror(errno)); + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug( + "IOCTL failure to read interface %s speed: %d %s", + ifname, errno, safe_strerror(errno)); ecmd.speed_hi = 0; ecmd.speed = 0; } -- 2.39.5