summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-06-17 19:38:04 +0200
committerThomas Haller <thaller@redhat.com>2016-06-30 08:29:55 +0200
commitda3f608802e9850c885e3ad96cec4fd97a75bbab (patch)
tree364ca2c1cbad86a3854e18a92757c6300addc611
parent6db3c80aba13e401d0f4ed87f65849b985feb2ed (diff)
downloadNetworkManager-da3f608802e9850c885e3ad96cec4fd97a75bbab.tar.gz
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.
-rw-r--r--src/devices/nm-device.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index d857288290..0b4432ecfd 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -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");
}
}
}