From 7f5957c8a73448f8d0916f68af4a7002005628fa Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Sat, 20 Oct 2018 05:21:28 +0200 Subject: [PATCH] wifi/iwd: check priv->dbus_obj in is_available is_available would recently return true after IWD had disconnected if a connection was active because it would check that priv->dbus_station_proxy was non-NULL (i.e. that the DBus interface was still visible, which it wasn't) but that check would be overridden if the NMDevice state was activated. Now require priv->dbus_obj to be non-NULL, which would even be enough on its own although I'm leaving the previous check there too to catch potential IWD states we don't support in which priv->dbus_station_proxy is NULL without an active connection. --- src/devices/wifi/nm-device-iwd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c index 8fb1f269e5..8ab0ba6968 100644 --- a/src/devices/wifi/nm-device-iwd.c +++ b/src/devices/wifi/nm-device-iwd.c @@ -952,7 +952,8 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags) * We call nm_device_queue_recheck_available whenever * priv->enabled changes or priv->dbus_station_proxy changes. */ - return priv->enabled + return priv->dbus_obj + && priv->enabled && ( priv->dbus_station_proxy || (state >= NM_DEVICE_STATE_CONFIG && state <= NM_DEVICE_STATE_DEACTIVATING)); }