diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 0f775f7a35..c05b6cc6a3 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -15021,10 +15021,11 @@ set_managed(NMDevice *self, NMDeviceManaged managed, NMDeviceManagedFlags flags, /* If requested, set the administrative state of the device to UP if the * new managed state is YES, and to DOWN if it's NO. */ if (flags & NM_DEVICE_MANAGED_FLAGS_SET_ADMIN_STATE) { - nm_platform_link_change_flags(nm_device_get_platform(self), - nm_device_get_ifindex(self), - IFF_UP, - !!managed); + if (nm_device_get_ifindex(self)) + nm_platform_link_change_flags(nm_device_get_platform(self), + nm_device_get_ifindex(self), + IFF_UP, + !!managed); } } }