mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 03:32:42 +01:00
station: Give network a connection failed hint
Right now, if the connection fails, then network always thinks that the password should be re-asked. Loosen this to only do so if the connection failed at least in the handshake phase. If the connection failed due to Association / Authentication timeout, it is likely that something is wrong with the AP and it can't respond.
This commit is contained in:
parent
e70b252e19
commit
254cefcc96
@ -595,13 +595,13 @@ close_settings:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void network_connect_failed(struct network *network)
|
||||
void network_connect_failed(struct network *network, bool in_handshake)
|
||||
{
|
||||
/*
|
||||
* Connection failed, if PSK try asking for the passphrase
|
||||
* once more
|
||||
* Connection failed during the handshake phase. If PSK try asking
|
||||
* for the passphrase once more
|
||||
*/
|
||||
if (network_get_security(network) == SECURITY_PSK) {
|
||||
if (network_get_security(network) == SECURITY_PSK && in_handshake) {
|
||||
network->update_psk = false;
|
||||
network->ask_passphrase = true;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ const struct network_info *network_get_info(const struct network *network);
|
||||
void network_set_info(struct network *network, struct network_info *info);
|
||||
|
||||
int network_autoconnect(struct network *network, struct scan_bss *bss);
|
||||
void network_connect_failed(struct network *network);
|
||||
void network_connect_failed(struct network *network, bool in_handshake);
|
||||
bool network_bss_add(struct network *network, struct scan_bss *bss);
|
||||
bool network_bss_list_isempty(struct network *network);
|
||||
void network_bss_list_clear(struct network *network);
|
||||
|
@ -2343,7 +2343,11 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
|
||||
|
||||
if (result != NETDEV_RESULT_OK) {
|
||||
if (result != NETDEV_RESULT_ABORTED) {
|
||||
network_connect_failed(station->connected_network);
|
||||
bool in_handshake =
|
||||
result == NETDEV_RESULT_HANDSHAKE_FAILED;
|
||||
|
||||
network_connect_failed(station->connected_network,
|
||||
in_handshake);
|
||||
station_disassociated(station);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user