From: Renato Westphal Date: Wed, 2 Jan 2019 18:47:51 +0000 (-0200) Subject: zebra: silence harmless ioctl warning when retrieving interface speed X-Git-Tag: frr-7.1-dev~55^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f767cee4eb80e4f90208daee096c5203a9eb7af4;p=mirror%2Ffrr.git zebra: silence harmless ioctl warning when retrieving interface speed 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 --- diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index f4bd193569..4e49c1fc58 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -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));