aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2020-06-09 10:00:02 -0500
committerDenis Kenzior <denkenz@gmail.com>2020-06-09 10:03:33 -0500
commit532f6b154e03b5fa222502098b5688a1784cc4e3 (patch)
tree76247bc442f8056fab56df3e3b8c9da995faa7c4
parent32a55fb75cd45e09e0f16fb4b1681172b296f5a4 (diff)
downloadiwd-532f6b154e03b5fa222502098b5688a1784cc4e3.tar.gz
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>
-rw-r--r--src/station.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/station.c b/src/station.c
index c532319a9..ca6a0b8ed 100644
--- a/src/station.c
+++ b/src/station.c
@@ -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)