diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2023-07-12 14:43:25 +0000 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2023-07-12 14:43:25 +0000 |
commit | 2d261ec7689d9657539fa589f3714f9c35e37079 (patch) | |
tree | 345056ae6bcc9beeeba61321387f39eff5a96f54 | |
parent | efa63aef3aeb063becea9161d4d25184dc896020 (diff) | |
parent | 215bc1525501b22325c2a17090a5f911e01f06a9 (diff) |
merge: branch 'fix_ovs'
device: do not set MAC address on iface with index <=0
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1691
-rw-r--r-- | src/core/devices/nm-device.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 40b88db1b9..10df06ae7e 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -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. */ |