mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 21:40:08 +01:00
device: don't clear the current MAC address
When we were able to read a MAC address previously, we would not expect a failure the next time. Say a failure happens. Still, we should not clear the MAC address, because we also determine hw_addr_len based on that address. And hw_addr_perm and hw_addr_initial have the same length. When we allow hw_addr to be reset (and possibly reset to a different address length), we somehow have to re-fresh also the permanent and initial MAC address. Just don't allow for that complexity, when it's not even clear what such a scenario would mean and what do to in that case.
This commit is contained in:
parent
6db3c80aba
commit
da3f608802
1 changed files with 5 additions and 4 deletions
|
|
@ -11406,11 +11406,12 @@ nm_device_update_hw_address (NMDevice *self)
|
|||
} else {
|
||||
/* Invalid or no hardware address */
|
||||
if (priv->hw_addr_len != 0) {
|
||||
g_clear_pointer (&priv->hw_addr, g_free);
|
||||
priv->hw_addr_len = 0;
|
||||
_LOGD (LOGD_HW | LOGD_DEVICE,
|
||||
"hw-addr: previous hardware address is no longer valid");
|
||||
_notify (self, PROP_HW_ADDRESS);
|
||||
"hw-addr: failed reading current MAC address (stay with %s)",
|
||||
priv->hw_addr);
|
||||
} else {
|
||||
_LOGD (LOGD_HW | LOGD_DEVICE,
|
||||
"hw-addr: failed reading current MAC address");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue