mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 05:58:01 +02:00
wifi: don't request new PSK for locally-generated WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY errors
This usually indicates that the driver missed beacons from the AP, due to driver bugs
or faulty power-save management. It doesn't mean that the PSK is wrong.
(cherry picked from commit 0c5aa6e48b)
This commit is contained in:
parent
e4a9bcde82
commit
3b225f893e
1 changed files with 11 additions and 1 deletions
|
|
@ -1760,6 +1760,7 @@ need_new_8021x_secrets (NMDeviceWifi *self,
|
||||||
static gboolean
|
static gboolean
|
||||||
need_new_wpa_psk (NMDeviceWifi *self,
|
need_new_wpa_psk (NMDeviceWifi *self,
|
||||||
guint32 old_state,
|
guint32 old_state,
|
||||||
|
gint disconnect_reason,
|
||||||
const char **setting_name)
|
const char **setting_name)
|
||||||
{
|
{
|
||||||
NMSettingWirelessSecurity *s_wsec;
|
NMSettingWirelessSecurity *s_wsec;
|
||||||
|
|
@ -1780,6 +1781,15 @@ need_new_wpa_psk (NMDeviceWifi *self,
|
||||||
key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
|
key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
|
||||||
|
|
||||||
if (g_strcmp0 (key_mgmt, "wpa-psk") == 0) {
|
if (g_strcmp0 (key_mgmt, "wpa-psk") == 0) {
|
||||||
|
/* -4 (locally-generated WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY) usually
|
||||||
|
* means the driver missed beacons from the AP. This usually happens
|
||||||
|
* due to driver bugs or faulty power-save management. It doesn't
|
||||||
|
* indicate that the PSK is wrong.
|
||||||
|
*/
|
||||||
|
#define LOCAL_WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY -4
|
||||||
|
if (disconnect_reason == LOCAL_WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
*setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
|
*setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -1805,7 +1815,7 @@ handle_8021x_or_psk_auth_fail (NMDeviceWifi *self,
|
||||||
g_return_val_if_fail (req != NULL, FALSE);
|
g_return_val_if_fail (req != NULL, FALSE);
|
||||||
|
|
||||||
if ( need_new_8021x_secrets (self, old_state, &setting_name)
|
if ( need_new_8021x_secrets (self, old_state, &setting_name)
|
||||||
|| need_new_wpa_psk (self, old_state, &setting_name)) {
|
|| need_new_wpa_psk (self, old_state, disconnect_reason, &setting_name)) {
|
||||||
|
|
||||||
nm_act_request_clear_secrets (req);
|
nm_act_request_clear_secrets (req);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue