]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: silence harmless ioctl warning when retrieving interface speed
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 2 Jan 2019 18:47:51 +0000 (16:47 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 2 Jan 2019 20:18:26 +0000 (18:18 -0200)
zebra uses the SIOCETHTOOL ioctl with the ETHTOOL_GSET command to
fetch the speed of interfaces from the kernel. The only problem is
that ETHTOOL_GSET returns EOPNOTSUPP when the given interface is a
virtual interface. This leads to zebra emitting warnings like this
at startup:

ZEBRA: IOCTL failure to read interface lo speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface dummy0 speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface ovs-system speed: 95 Operation not supported

Silence these warnings by ignoring EOPNOTSUPP errors, since we know
they are harmless. This is similar to how we handle EINVAL errors
from the BSD SIOCGIFMEDIA ioctl (commit c69f2c1ff).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/if_netlink.c

index f4bd193569b89444173a5f14e1248324f0d7ee7a..4e49c1fc5810126b2a0c5175264627b6149e03bb 100644 (file)
@@ -399,7 +399,7 @@ static int get_iflink_speed(struct interface *interface)
                               (char *)&ifdata);
        }
        if (rc < 0) {
-               if (IS_ZEBRA_DEBUG_KERNEL)
+               if (errno != EOPNOTSUPP && IS_ZEBRA_DEBUG_KERNEL)
                        zlog_debug(
                                "IOCTL failure to read interface %s speed: %d %s",
                                ifname, errno, safe_strerror(errno));