station: Do not enter autoconnect_full erroneously

If a connection is initiated (via dbus) while a quick scan is in
progress, the quick scan will be aborted.  In this case,
station_quick_scan_results will always transition to the
AUTOCONNECT_FULL state regardless of whether it should or not.

Fix this by making sure that we only enter AUTOCONNECT_FULL if we're
still in the AUTOCONNECT_QUICK state.

Reported-by: Alvin Šipraga <alsi@bang-olufsen.dk>
This commit is contained in:
Denis Kenzior 2020-06-09 10:00:02 -05:00
parent 32a55fb75c
commit 532f6b154e
1 changed files with 4 additions and 6 deletions

View File

@ -1059,15 +1059,13 @@ static bool station_quick_scan_results(int err, struct l_queue *bss_list,
station_property_set_scanning(station, false);
if (err) {
station_enter_state(station, STATION_STATE_AUTOCONNECT_FULL);
return false;
}
if (err)
goto done;
autoconnect = station_is_autoconnecting(station);
station_set_scan_results(station, bss_list, autoconnect);
done:
if (station->state == STATION_STATE_AUTOCONNECT_QUICK)
/*
* If we're still in AUTOCONNECT_QUICK state, then autoconnect
@ -1075,7 +1073,7 @@ static bool station_quick_scan_results(int err, struct l_queue *bss_list,
*/
station_enter_state(station, STATION_STATE_AUTOCONNECT_FULL);
return true;
return err == 0;
}
static void station_quick_scan_triggered(int err, void *user_data)