In some congested environments APs return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA on auth/assoc attempt. Instead of failing immediately, retry again in 200 msec. Signed-off-by: Eliad Peller <eliad@xxxxxxxxxx> --- depends on "mac80211: fail authentication when AP denied authentication" net/mac80211/mlme.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2b5235e..6b3ce84 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1790,6 +1790,19 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, if (status_code != WLAN_STATUS_SUCCESS) { printk(KERN_DEBUG "%s: %pM denied authentication (status %d)\n", sdata->name, mgmt->sa, status_code); + + if (status_code == WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA) { + /* can't auth right now, try again in 200 ms */ + u32 ms = 200; + printk(KERN_DEBUG "%s: %pM rejected authentication; " + "try again in %u ms\n", + sdata->name, mgmt->sa, ms); + ifmgd->auth_data->timeout = jiffies + + msecs_to_jiffies(ms); + run_again(ifmgd, ifmgd->auth_data->timeout); + return RX_MGMT_NONE; + } + ieee80211_destroy_auth_data(sdata, false); return RX_MGMT_CFG80211_RX_AUTH; } @@ -2152,6 +2165,17 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, return RX_MGMT_NONE; } + if (status_code == WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA) { + /* can't assoc us right now, try again in 200 ms */ + u32 ms = 200; + printk(KERN_DEBUG "%s: %pM rejected association; " + "try again in %u ms\n", + sdata->name, mgmt->sa, ms); + assoc_data->timeout = jiffies + msecs_to_jiffies(ms); + run_again(ifmgd, assoc_data->timeout); + return RX_MGMT_NONE; + } + *bss = assoc_data->bss; if (status_code != WLAN_STATUS_SUCCESS) { -- 1.7.6.401.g6a319 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html