diff options
author | Thomas Haller <thaller@redhat.com> | 2016-05-20 18:10:51 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-06-30 08:29:55 +0200 |
commit | 2f05353d9e4282c2ef2b9945c0f20a288a21a4b9 (patch) | |
tree | 717d26d2e0cadd80466616f5c3b644e3ff58ec48 | |
parent | 3704197d873a4f7d94947299dd3d750cd6d46e6c (diff) | |
download | NetworkManager-2f05353d9e4282c2ef2b9945c0f20a288a21a4b9.tar.gz |
device: re-read initial hw-address before activating connection
Previously, we would only once read the initial hardware address during
device realization.
When a device activates, NetworkManager always sets the MAC address as configured
in the cloned-mac-address setting -- or, if unspecified -- it falls back
to use the permanent hardware-address instead.
Later, when deactivating the device, the MAC address is reset to the
"inital MAC address".
This patch changes, that the "initial MAC address" is re-read every time
before activating the device, contrary to reading it once in the
beginning.
This allows for a user to first start NetworkManager and later change the
MAC address of the device. When activating the device, NM will reset the
MAC address for the time the device is active. But when disconnecting,
it resets to the user-changed value, not the value when NM was started.
https://bugzilla.gnome.org/show_bug.cgi?id=708820
-rw-r--r-- | src/devices/nm-device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1f6c72406b..c2d9224700 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -11041,6 +11041,9 @@ _set_state_full (NMDevice *self, } } break; + case NM_DEVICE_STATE_PREPARE: + nm_device_update_initial_hw_address (self); + break; case NM_DEVICE_STATE_NEED_AUTH: if (old_state > NM_DEVICE_STATE_NEED_AUTH) { /* Clean up any half-done IP operations if the device's layer2 |