fixup! core: device: allow to change the admin state of the device in SetManaged()

This commit is contained in:
Íñigo Huguet 2026-03-03 10:21:21 +01:00
parent bd72fdd720
commit f0380dffc9

View file

@ -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);
}
}
}