]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Guard debugs in interface speed check
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 7 Jul 2017 13:45:15 +0000 (09:45 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Aug 2017 14:28:54 +0000 (10:28 -0400)
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 <sharpd@cumulusnetworks.com>
zebra/if_netlink.c

index 8064071c3794a9b7ba1b2d791feb6d6a65470b6c..0d081551785b47c64474b6afacd33fabf4fa5ef8 100644 (file)
@@ -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;
        }