From fbe6240a7d631156e80cf68ad8308476ed36dc6e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 10 Dec 2020 11:50:18 +0100 Subject: [PATCH] wifi: fix evaluating the scanning state for wpa-supplicant wpa_supplicant has a property "scanning" and a "state=scanning". Previously, NetworkManager considered both parts to indicate whether supplicant is currently scanning (if either the property or the state indicated scanning, it took that as indication for scanning). If NetworkManager thinks that supplicant is scanning, it suppresses explicit "Scan" requests. That alone is not severe, because the "Scan" request is only to trigger a scan in supplicant (which supplicant possibly is already doing in state "scanning"). However, what is severe is that NetworkManager will also block autoconnect while supplicant is scanning. That is because NetworkManager wants to get a complete scan result before deciding which network to connect to. It seems that wpa_supplicant can get into "state=scanning" and stay there indefinitely. This prevents NetworkManager from autoactivating a profile. Fix that, to only honor the "scanning" property. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/597 Fixes: b83f07916a54 ('supplicant: large rework of wpa_supplicant handling') (cherry picked from commit 8cadfed2fe3540c04572fec283bdf09e14113192) --- src/supplicant/nm-supplicant-interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c index 77254c7ebc..065521295d 100644 --- a/src/supplicant/nm-supplicant-interface.c +++ b/src/supplicant/nm-supplicant-interface.c @@ -457,9 +457,7 @@ _notify_maybe_scanning(NMSupplicantInterface *self) NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE(self); gboolean scanning; - scanning = - nm_supplicant_interface_state_is_operational(priv->state) - && (priv->scanning_property || priv->supp_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING); + scanning = nm_supplicant_interface_state_is_operational(priv->state) && priv->scanning_property; if (priv->scanning_cached == scanning) return;