From: Donald Sharp Date: Fri, 7 Jul 2017 13:45:15 +0000 (-0400) Subject: zebra: Guard debugs in interface speed check X-Git-Tag: frr-4.0-dev~431^2~12 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=bd7d02999f1d1c2a4aaa484c24738d31f80aab82;p=mirror%2Ffrr.git 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 --- 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; }