2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

Reduce log level for ENODEV errors getting Ethernet address.

Bug #5844 reports several log messages of the form:

    netdev_linux|ERR|ioctl(SIOCGIFHWADDR) on vif426.1 device failed: No
    such device

during migrations.  These are normal and unavoidable, because the vifs
disappear from the kernel before they are removed them from the OVS
database.  Reduce the log level to avoid making people worry.

Bug #5844.
This commit is contained in:
Ben Pfaff
2011-06-16 14:02:10 -07:00
parent 32abfca082
commit 78857dfb3d

View File

@@ -4152,8 +4152,12 @@ get_etheraddr(const char *netdev_name, uint8_t ea[ETH_ADDR_LEN])
ovs_strzcpy(ifr.ifr_name, netdev_name, sizeof ifr.ifr_name);
COVERAGE_INC(netdev_get_hwaddr);
if (ioctl(af_inet_sock, SIOCGIFHWADDR, &ifr) < 0) {
VLOG_ERR("ioctl(SIOCGIFHWADDR) on %s device failed: %s",
netdev_name, strerror(errno));
/* ENODEV probably means that a vif disappeared asynchronously and
* hasn't been removed from the database yet, so reduce the log level
* to INFO for that case. */
VLOG(errno == ENODEV ? VLL_INFO : VLL_ERR,
"ioctl(SIOCGIFHWADDR) on %s device failed: %s",
netdev_name, strerror(errno));
return errno;
}
hwaddr_family = ifr.ifr_hwaddr.sa_family;