aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-26 05:57:41 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-26 06:37:38 -0500
commit028e8da0723a6f6a00d9d1e3dae9ad448a28987e (patch)
tree3052dd1c94c25dcd1260675fa6bad534fc1dd994
parent453e66f247f4ecb98cfef653164d428d087187d8 (diff)
mac80211: fix managed mode channel flags handling
If ieee80211_prep_channel() decides that HT should be disabled (because the HT IEs from the AP were invalid) it will set the IEEE80211_STA_DISABLE_HT to not send HT capabilities to the AP when associating. If this happens during authentication, the flag will be lost and we send HT frames, even if the channel config was set up for non-HT. This can lead to issues. Fix this by always resetting the ifmgd flags to zero when the channel context is released so that the flag resetting in ieee80211_mgd_assoc() isn't necessary. To make the code a bit easier move the call to release the channel in ieee80211_set_disassoc() to the end of the function together with the flag resetting (which needs to be at the end to avoid timers setting flags.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/mlme.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6d49d6c4ffc..2cec14cc02d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1528,8 +1528,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1528 changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT; 1528 changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT;
1529 ieee80211_bss_info_change_notify(sdata, changed); 1529 ieee80211_bss_info_change_notify(sdata, changed);
1530 1530
1531 ieee80211_vif_release_channel(sdata);
1532
1533 /* disassociated - set to defaults now */ 1531 /* disassociated - set to defaults now */
1534 ieee80211_set_wmm_default(sdata, false); 1532 ieee80211_set_wmm_default(sdata, false);
1535 1533
@@ -1539,6 +1537,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1539 del_timer_sync(&sdata->u.mgd.chswitch_timer); 1537 del_timer_sync(&sdata->u.mgd.chswitch_timer);
1540 1538
1541 sdata->u.mgd.timers_running = 0; 1539 sdata->u.mgd.timers_running = 0;
1540
1541 ifmgd->flags = 0;
1542 ieee80211_vif_release_channel(sdata);
1542} 1543}
1543 1544
1544void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, 1545void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
@@ -1864,6 +1865,7 @@ static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
1864 1865
1865 memset(sdata->u.mgd.bssid, 0, ETH_ALEN); 1866 memset(sdata->u.mgd.bssid, 0, ETH_ALEN);
1866 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 1867 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
1868 sdata->u.mgd.flags = 0;
1867 ieee80211_vif_release_channel(sdata); 1869 ieee80211_vif_release_channel(sdata);
1868 } 1870 }
1869 1871
@@ -2106,6 +2108,7 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
2106 2108
2107 memset(sdata->u.mgd.bssid, 0, ETH_ALEN); 2109 memset(sdata->u.mgd.bssid, 0, ETH_ALEN);
2108 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 2110 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
2111 sdata->u.mgd.flags = 0;
2109 ieee80211_vif_release_channel(sdata); 2112 ieee80211_vif_release_channel(sdata);
2110 } 2113 }
2111 2114
@@ -3536,13 +3539,6 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3536 3539
3537 /* prepare assoc data */ 3540 /* prepare assoc data */
3538 3541
3539 /*
3540 * keep only the 40 MHz disable bit set as it might have
3541 * been set during authentication already, all other bits
3542 * should be reset for a new connection
3543 */
3544 ifmgd->flags &= IEEE80211_STA_DISABLE_40MHZ;
3545
3546 ifmgd->beacon_crc_valid = false; 3542 ifmgd->beacon_crc_valid = false;
3547 3543
3548 /* 3544 /*