device: update address in nm_device_update_from_platform_link()

Merged Beniamino Galvani requested to merge bg/rh2168477 into main

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.

Merge request reports