mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 09:58:07 +02:00
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.
This commit is contained in:
parent
88eb6ced3f
commit
157959a1c5
2 changed files with 2 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue