device: update the address type in nm_device_hw_addr_set_cloned()

Commit 029a0a21ea ("device: split out cloned MAC decision from
nm_device_hw_addr_set_cloned()") accidentally removed the assignment
of the new device @hw_addr_type, which then was left to
HW_ADDR_TYPE_UNSET. As a consequence, we never restored the initial
MAC address when the connection was deactivated. Fix this.

Fixes: 029a0a21ea
(cherry picked from commit 166988264f)
This commit is contained in:
Beniamino Galvani
2017-03-30 09:54:20 +02:00
parent 7dc010606b
commit 02d7084fc4

View File

@@ -13358,8 +13358,10 @@ nm_device_hw_addr_set_cloned (NMDevice *self, NMConnection *connection, gboolean
if (preserve)
return nm_device_hw_addr_reset (self, detail);
if (hwaddr)
if (hwaddr) {
priv->hw_addr_type = type;
return _hw_addr_set (self, hwaddr, "set-cloned", detail);
}
return TRUE;
}