mac80211: skip disabled channels in VHT check
authorArik Nemtsov <arik@wizery.com>
Thu, 1 Jan 2015 11:43:17 +0000 (13:43 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 6 Jan 2015 13:59:07 +0000 (14:59 +0100)
The patch "40a11ca mac80211: check if channels allow 80 MHz for VHT
probe requests" considered disabled channels as VHT enabled, and
mistakenly sent out probe-requests with the VHT IE.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 0f9bf479952eca8db4d811db942a369d0085542e..ad8cb4fb441e01f5e1de066f73b01d5a884ccf0c 100644 (file)
@@ -1470,10 +1470,12 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_local *local,
 
        /* Check if any channel in this sband supports at least 80 MHz */
        for (i = 0; i < sband->n_channels; i++) {
-               if (!(sband->channels[i].flags & IEEE80211_CHAN_NO_80MHZ)) {
-                       have_80mhz = true;
-                       break;
-               }
+               if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED |
+                                               IEEE80211_CHAN_NO_80MHZ))
+                       continue;
+
+               have_80mhz = true;
+               break;
        }
 
        if (sband->vht_cap.vht_supported && have_80mhz) {