merge: branch 'fix_ovs'

device: do not set MAC address on iface with index <=0

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1691
This commit is contained in:
Beniamino Galvani 2023-07-12 14:43:25 +00:00
commit 2d261ec768

View file

@ -17215,6 +17215,7 @@ nm_device_hw_addr_reset(NMDevice *self, const char *detail)
{
NMDevicePrivate *priv;
const char *addr;
int ifindex;
g_return_val_if_fail(NM_IS_DEVICE(self), FALSE);
@ -17224,7 +17225,13 @@ nm_device_hw_addr_reset(NMDevice *self, const char *detail)
return TRUE;
priv->hw_addr_type = HW_ADDR_TYPE_UNSET;
addr = nm_device_get_initial_hw_address(self);
ifindex = nm_device_get_ip_ifindex(self);
if (ifindex <= 0) {
return TRUE;
}
addr = nm_device_get_initial_hw_address(self);
if (!addr) {
/* as hw_addr_type is not UNSET, we expect that we can get an
* initial address to which to reset. */