commit c026337792323784addd71089a8ee2368a73d3a5
parent 603988476a6da8ce0a518abaf4b6655e2d378f9d
Author: James Prestwood <prestwoj@gmail.com>
Date: Thu, 4 Feb 2021 16:06:02 -0800
station: move scan cancelation to __station_connect_network
An earlier patch fixed a problem where a queued quick scan would
be triggered and fail once already connected, resulting in a state
transition from connected --> autoconnect_full. This fixed the
Connect() path but this could also happen via autoconnect. Starting
from a connected state, the sequence goes:
- DBus scan is triggered
- AP disconnects IWD
- State transition from disconnected --> autoconnect_quick
- Queue quick scan
- DBus scan results come in and used to autoconnect
- A connect work item is inserted ahead of all others, transition
from autoconnect_quick --> connecting.
- Connect completes, transition from connecting --> connected
- Quick scan can finally get triggered, which the kernel fails to
do since IWD is connected, transition from connected -->
autoconnect_full.
This can be fixed by checking for a pending quick scan in the
autoconnect path.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/station.c b/src/station.c
@@ -196,6 +196,13 @@ static void station_autoconnect_next(struct station *station)
if (!r) {
station_enter_state(station, STATION_STATE_CONNECTING);
+
+ if (station->quick_scan_id) {
+ scan_cancel(netdev_get_wdev_id(station->netdev),
+ station->quick_scan_id);
+ station->quick_scan_id = 0;
+ }
+
return;
}
}