5481645
From ddfe49b42d8ad4bfdf92d63d4a74f162660d878d Mon Sep 17 00:00:00 2001
5481645
From: Johannes Berg <johannes.berg@intel.com>
5481645
Date: Wed, 31 Jul 2013 18:52:03 +0000
5481645
Subject: mac80211: continue using disabled channels while connected
5481645
5481645
In case the AP has different regulatory information than we do,
5481645
it can happen that we connect to an AP based on e.g. the world
5481645
roaming regulatory data, and then update our database with the
5481645
AP's country information disables the channel the AP is using.
5481645
If this happens on an HT AP, the bandwidth tracking code will
5481645
hit the WARN_ON() and disconnect. Since that's not very useful,
5481645
ignore the channel-disable flag in bandwidth tracking.
5481645
5481645
Cc: stable@vger.kernel.org
5481645
Reported-by: Chris Wright <chrisw@sous-sol.org>
5481645
Tested-by: Chris Wright <chrisw@sous-sol.org>
5481645
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5481645
---
5481645
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
5481645
index 077a953..cc9e02d 100644
5481645
--- a/net/mac80211/mlme.c
5481645
+++ b/net/mac80211/mlme.c
5481645
@@ -335,8 +335,17 @@ out:
5481645
 	if (ret & IEEE80211_STA_DISABLE_VHT)
5481645
 		vht_chandef = *chandef;
5481645
 
5481645
+	/*
5481645
+	 * Ignore the DISABLED flag when we're already connected and only
5481645
+	 * tracking the APs beacon for bandwidth changes - otherwise we
5481645
+	 * might get disconnected here if we connect to an AP, update our
5481645
+	 * regulatory information based on the AP's country IE and the
5481645
+	 * information we have is wrong/outdated and disables the channel
5481645
+	 * that we're actually using for the connection to the AP.
5481645
+	 */
5481645
 	while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef,
5481645
-					IEEE80211_CHAN_DISABLED)) {
5481645
+					tracking ? 0 :
5481645
+						   IEEE80211_CHAN_DISABLED)) {
5481645
 		if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) {
5481645
 			ret = IEEE80211_STA_DISABLE_HT |
5481645
 			      IEEE80211_STA_DISABLE_VHT;
5481645
--
5481645
cgit v0.9.2