eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 532f6b154e03b5fa222502098b5688a1784cc4e3
parent 32a55fb75cd45e09e0f16fb4b1681172b296f5a4
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Tue,  9 Jun 2020 10:00:02 -0500

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>

Diffstat:
Msrc/station.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 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)