diff options
author | Thomas Haller <thaller@redhat.com> | 2015-10-07 16:27:32 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-10-07 16:35:06 +0200 |
commit | e73e55c6ec703731a9d6c821cae33e4a4fd0721b (patch) | |
tree | bf459f17fc99420a2f387f42a09428d2c8fe760c | |
parent | 3abe1bb21a58bd943d065ce95886980e081ae48c (diff) | |
download | NetworkManager-e73e55c6ec703731a9d6c821cae33e4a4fd0721b.tar.gz |
device: update hw_addr_len before emitting signal in nm_device_update_hw_address()
-rw-r--r-- | src/devices/nm-device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index cac9094930..5fd7bfff7d 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -9255,6 +9255,7 @@ nm_device_update_hw_address (NMDevice *self) hwaddr = nm_platform_link_get_address (NM_PLATFORM_GET, ifindex, &hwaddrlen); if (hwaddrlen) { + priv->hw_addr_len = hwaddrlen; if (!priv->hw_addr || !nm_utils_hwaddr_matches (priv->hw_addr, -1, hwaddr, hwaddrlen)) { g_free (priv->hw_addr); priv->hw_addr = nm_utils_hwaddr_ntoa (hwaddr, hwaddrlen); @@ -9266,12 +9267,12 @@ nm_device_update_hw_address (NMDevice *self) /* 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, "previous hardware address is no longer valid"); g_object_notify (G_OBJECT (self), NM_DEVICE_HW_ADDRESS); } } - priv->hw_addr_len = hwaddrlen; } gboolean |