mac80211: Look out for some other AP when disassoc is received.
PATCH 1/1 mac80211: Look out for some other AP when disassoc is received.
When a disassoc packet is received with a reason code of 'AP leaving the BSS', mac80211 should start looking for some other AP instead of trying to associate with the same AP.
--- net/mac80211/mlme.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +6 -2
@@ -808,6 +808,10 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,mod_timer (&ifsta->timer, jiffies +IEEE80211_AUTH_TIMEOUT ); } +/* +* The disassoc 'reason' argument can be either our own reason +* if self disconnected or a reason code from the AP. +*/ static void ieee80211_set_disassoc (struct ieee80211_sub_if_data *sdata,struct ieee80211_if_sta *ifsta,bool deauth,bool self_disconnected,u16 reason)
@@ -854,7 +858,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,ieee80211_sta_send_apinfo (sdata, ifsta); -if (self_disconnected) +if (self_disconnected || reason ==WLAN_REASON_DISASSOC_STA_HAS_LEFT ) ifsta->state =IEEE80211_STA_MLME_DISABLED ;sta_info_unlink (&sta);
@@ -1175,7 +1179,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, IEEE80211_RETRY_AUTH_INTERVAL); } -ieee80211_set_disassoc (sdata, ifsta, false, false,0 ); +ieee80211_set_disassoc (sdata, ifsta, false, false, reason_code); }
Signature · 1 line
1.5.6.4
Quoted 3 lines · Vivek Natarajan
When a disassoc packet is received with a reason code of 'AP leaving the BSS', mac80211 should start looking for some other AP instead of trying to associate with the same AP.
Can we edit this commit log message? mac80211 will not start looking for another AP in DISABLED state. How about
When a disassoc packet is received from the AP with a reason code of 'leaving the BSS', mac80211 should go into DISABLED state just as it would do if the AP suddenly went away for some reason, as that is what will happen shortly after the AP leaves anyway.
(is that correct?)
Other than that,
Quoted 38 lines
Signed-off-by Vivek Natarajan <[email protected]>--- net/mac80211/mlme.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)net/mac80211/mlme.c +6
-2@@ -808,6 +808,10 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,mod_timer (&ifsta->timer, jiffies +IEEE80211_AUTH_TIMEOUT ); } +/* +* The disassoc 'reason' argument can be either our own reason +* if self disconnected or a reason code from the AP. +*/ static void ieee80211_set_disassoc (struct ieee80211_sub_if_data *sdata,struct ieee80211_if_sta *ifsta,bool deauth,bool self_disconnected,u16 reason)@@ -854,7 +858,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,ieee80211_sta_send_apinfo (sdata, ifsta); -if (self_disconnected) +if (self_disconnected || reason ==WLAN_REASON_DISASSOC_STA_HAS_LEFT ) ifsta->state =IEEE80211_STA_MLME_DISABLED ;sta_info_unlink (&sta);@@ -1175,7 +1179,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, IEEE80211_RETRY_AUTH_INTERVAL); } -ieee80211_set_disassoc (sdata, ifsta, false, false,0 ); +ieee80211_set_disassoc (sdata, ifsta, false, false, reason_code); }