diff options
author | Dan Williams <dcbw@redhat.com> | 2016-12-16 11:34:29 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2016-12-20 10:06:42 -0600 |
commit | 0c5aa6e48b713a5626c20303c683f7d96ee13184 (patch) | |
tree | d3437959fe372e6a8ffc22fe89af40816c4463c4 | |
parent | 16aeac5c3ebf543eb1ebcb36487b2babbf271004 (diff) | |
download | NetworkManager-0c5aa6e48b713a5626c20303c683f7d96ee13184.tar.gz |
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.
-rw-r--r-- | src/devices/wifi/nm-device-wifi.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 4c56aa7c65..5645ad3c7a 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -1892,6 +1892,7 @@ need_new_8021x_secrets (NMDeviceWifi *self, static gboolean need_new_wpa_psk (NMDeviceWifi *self, guint32 old_state, + gint disconnect_reason, const char **setting_name) { NMSettingWirelessSecurity *s_wsec; @@ -1912,6 +1913,15 @@ need_new_wpa_psk (NMDeviceWifi *self, key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec); 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; return TRUE; } @@ -1937,7 +1947,7 @@ handle_8021x_or_psk_auth_fail (NMDeviceWifi *self, g_return_val_if_fail (req != NULL, FALSE); 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); |