From 02d7084fc4a80cdef5f62bc63d044ea4f1bf6c49 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 30 Mar 2017 09:54:20 +0200 Subject: [PATCH] device: update the address type in nm_device_hw_addr_set_cloned() Commit 029a0a21ea1e ("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: 029a0a21ea1ebf74a10253845396f06b0194853a (cherry picked from commit 166988264f114344759e6faa08e3cadce87c62a6) --- src/devices/nm-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 06ed121f4..70ec90235 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -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; }