station: Make Disconnect() cancel ConnectHiddenNetwork()

ConnectHiddenNetwork can be seen a triggering this sequence:
1. the active scan,
2. the optional agent request,
3. the Authentication/Association/4-Way Handshake/netconfig,
4. connected state

Currently Disconnect() interrupts 3 and 4, allow it to also interrupt
state 1.  It's difficult to tell whether we're in state 2 from within
station.c.
This commit is contained in:
Andrew Zaborowski 2020-10-08 10:49:07 +02:00 committed by Denis Kenzior
parent 84e32ba448
commit 758dba214e
1 changed files with 9 additions and 0 deletions

View File

@ -2749,6 +2749,15 @@ static struct l_dbus_message *station_dbus_disconnect(struct l_dbus *dbus,
*/
station_set_autoconnect(station, false);
if (station->hidden_network_scan_id) {
scan_cancel(netdev_get_wdev_id(station->netdev),
station->hidden_network_scan_id);
dbus_pending_reply(&station->hidden_pending,
dbus_error_aborted(station->hidden_pending));
return l_dbus_message_new_method_return(message);
}
if (!station_is_busy(station))
return l_dbus_message_new_method_return(message);