From 8b26cb35eeca8ef808272b8f47340ab6c0e077ee Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 20 Aug 2025 16:51:05 +0200 Subject: [PATCH] device: explicitly handle unrealized devices in is_available() Unrealized software devices are always available for activation, hardware devices never. In nm_manager_get_best_device_for_activation() we call nm_device_is_available() on candidate devices. Without this fix, any unrealized software device would be not considered ready for activation, which is wrong. A software device can override the default implementation of is_available(). For example NMDeviceOvsInterface does that and only checks the OVSDB is ready. Fixes: ba86c208e0aa ('Revert "core: prevent the activation of unavailable OVS interfaces only"') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2253 --- src/core/devices/nm-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 29061f3d6a..7cacd5ff3f 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -9164,6 +9164,10 @@ is_available(NMDevice *self, NMDeviceCheckDevAvailableFlags flags) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); + /* unrealized software devices are always available, hardware devices never */ + if (!nm_device_is_real(self)) + return nm_device_is_software(self); + if (priv->carrier || priv->ignore_carrier) return TRUE;