mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 15:10:09 +01:00
iwd: Don't auto-scan while waiting for secrets
IWD's Station.State property remains at "connect" or "disconnected"
while IWD is waiting for secrets for a new conncetion, so if we want to
scan only when NM might be in auto-connect (which was the goal) we need
to also look at NMDevice's state. We want to scan whenever wifi is
disconnected and there's no active connection request, which is the same
as saying whever priv->current_ap is unset so for simplicity look at
priv->current_ap. Also in schedule_periodic_scan() don't check whether
Station.State is "disconnected" because priv->can_scan is equivalent to
Station.State being one of ("disconnected", "connected").
This commit is contained in:
parent
4f83960ff5
commit
61e4b5a230
1 changed files with 2 additions and 9 deletions
|
|
@ -162,6 +162,7 @@ set_current_ap(NMDeviceIwd *self, NMWifiAP *new_ap, gboolean recheck_available_c
|
|||
|
||||
_notify(self, PROP_ACTIVE_ACCESS_POINT);
|
||||
_notify(self, PROP_MODE);
|
||||
schedule_periodic_scan(self, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1958,16 +1959,8 @@ static void
|
|||
schedule_periodic_scan(NMDeviceIwd *self, gboolean initial_scan)
|
||||
{
|
||||
NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE(self);
|
||||
GVariant * value;
|
||||
gboolean disconnected = TRUE;
|
||||
guint interval;
|
||||
|
||||
if (priv->can_scan) {
|
||||
value = g_dbus_proxy_get_cached_property(priv->dbus_station_proxy, "State");
|
||||
disconnected = nm_streq0(get_variant_state(value), "disconnected");
|
||||
g_variant_unref(value);
|
||||
}
|
||||
|
||||
/* Start scan immediately after a disconnect, mode change or
|
||||
* device UP, otherwise wait 10 seconds. When connected, update
|
||||
* AP list mainly on UI requests.
|
||||
|
|
@ -1979,7 +1972,7 @@ schedule_periodic_scan(NMDeviceIwd *self, gboolean initial_scan)
|
|||
* exit autoconnect and interrupt the ongoing scan, meaning that
|
||||
* we still want a new scan ASAP.
|
||||
*/
|
||||
if (!priv->can_scan || !disconnected || priv->scan_requested || priv->scanning)
|
||||
if (!priv->can_scan || priv->scan_requested || priv->scanning || priv->current_ap)
|
||||
interval = -1;
|
||||
else if (initial_scan)
|
||||
interval = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue