diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2023-02-10 17:33:23 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2023-02-20 17:35:35 +0100 |
commit | d403ac3d40264876c75298e7b4d475a8b49c0921 (patch) | |
tree | e6b3b003ccc1a3bd05478a57a1c08c86b17315f5 | |
parent | a1cdec78940558eb76ac117c2d4b5900b81980b8 (diff) | |
download | NetworkManager-d403ac3d40264876c75298e7b4d475a8b49c0921.tar.gz |
device: update address in nm_device_update_from_platform_link()bg/rh2168477
When a software device is deactivated, normally we schedule a idle
task to unrealize the device (delete_on_deactivate). However, if a new
activation is enqueued on the same device (and that implies that the
new profile is compatible with the device), then the idle task is not
scheduled and the device will normally transition to the different
states (disconnected, prepare, config, etc.).
For ovs-interfaces, we remove the db entry on disconnect and that
makes the link go away; however, we don't clear the hw_addr* fields of
the device struct.
When the new link appears, we try to set the new cloned MAC but the
stale hw_addr field indicates that it's already set. Avoid this
problem by updating the address as soon as the link appears.
https://bugzilla.redhat.com/show_bug.cgi?id=2168477
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1532
-rw-r--r-- | src/core/devices/nm-device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index a00a1aa2b5..a6c66a96d3 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -7171,6 +7171,9 @@ nm_device_update_from_platform_link(NMDevice *self, const NMPlatformLink *plink) ifindex_changed = _set_ifindex(self, plink ? plink->ifindex : 0, FALSE); + nm_device_update_hw_address(self); + nm_device_update_permanent_hw_address(self, FALSE); + if (ifindex_changed) NM_DEVICE_GET_CLASS(self)->link_changed(self, plink); |