mac80211: Deny TX BA session requests during disassociation
authorSujith <Sujith.Manoharan@atheros.com>
Wed, 10 Feb 2010 09:22:21 +0000 (14:52 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 10 Feb 2010 21:36:52 +0000 (16:36 -0500)
In associated state, when bringing an interface down, existing
BA sessions are torn down. When this is in progress, nothing
prevents mac80211 from accepting another BA session start request.

Use a new station flag to fix this.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/agg-tx.c
net/mac80211/mlme.c
net/mac80211/sta_info.h

index 718fbcff84d24e230fadd5808a80d12aee889020..5538e1b4a697740535b0be966a90719cec3dafc5 100644 (file)
@@ -237,6 +237,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
            sdata->vif.type != NL80211_IFTYPE_AP)
                return -EINVAL;
 
+       if (test_sta_flags(sta, WLAN_STA_DISASSOC)) {
+#ifdef CONFIG_MAC80211_HT_DEBUG
+               printk(KERN_DEBUG "Disassociation is in progress. "
+                      "Denying BA session request\n");
+#endif
+               return -EINVAL;
+       }
+
        if (test_sta_flags(sta, WLAN_STA_SUSPEND)) {
 #ifdef CONFIG_MAC80211_HT_DEBUG
                printk(KERN_DEBUG "Suspend in progress. "
index ee9443dc20ff1f54300de02926008990cef21004..bfc4a507001362a06bd775135548d8610274df7c 100644 (file)
@@ -797,8 +797,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata)
 
        rcu_read_lock();
        sta = sta_info_get(sdata, bssid);
-       if (sta)
+       if (sta) {
+               set_sta_flags(sta, WLAN_STA_DISASSOC);
                ieee80211_sta_tear_down_BA_sessions(sta);
+       }
        rcu_read_unlock();
 
        changed |= ieee80211_reset_erp_info(sdata);
index 5ff611a35979349214fac33427f27f7a05f759ba..822d845229376116413cd07607b2e6a1ecb35f38 100644 (file)
@@ -42,6 +42,9 @@
  *     be in the queues
  * @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping
  *     station in power-save mode, reply when the driver unblocks.
+ * @WLAN_STA_DISASSOC: Disassociation in progress.
+ *     This is used to reject TX BA session requests when disassociation
+ *     is in progress.
  */
 enum ieee80211_sta_info_flags {
        WLAN_STA_AUTH           = 1<<0,
@@ -57,6 +60,7 @@ enum ieee80211_sta_info_flags {
        WLAN_STA_SUSPEND        = 1<<11,
        WLAN_STA_PS_DRIVER      = 1<<12,
        WLAN_STA_PSPOLL         = 1<<13,
+       WLAN_STA_DISASSOC       = 1<<14,
 };
 
 #define STA_TID_NUM 16