Commit 157959a1 authored by Dan Williams's avatar Dan Williams

core: fall back to current MAC address if permanent one is invalid

Not all drivers will return errors when even when they don't provide
the GPERMADDR ethtool call; sometimes you'll get 00:00:00:00:00:00
which is clearly not right.  In this case, fall back to the current
HW address just like if the ethtool GPERMADDR call failed.
parent 88eb6ced
......@@ -609,7 +609,7 @@ real_update_permanent_hw_address (NMDevice *dev)
errno = 0;
ret = ioctl (fd, SIOCETHTOOL, &req);
if (ret < 0) {
if ((ret < 0) || !nm_ethernet_address_is_valid ((struct ether_addr *) epaddr->data)) {
nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)",
nm_device_get_iface (dev), errno);
/* Fall back to current address */
......
......@@ -3032,7 +3032,7 @@ real_update_permanent_hw_address (NMDevice *dev)
errno = 0;
ret = ioctl (fd, SIOCETHTOOL, &req);
if (ret < 0) {
if ((ret < 0) || !nm_ethernet_address_is_valid ((struct ether_addr *) epaddr->data)) {
nm_log_err (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)",
nm_device_get_iface (dev), errno);
/* Fall back to current address */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment