diff mbox

mac80211: check csa wiphy flag in ibss before switching

Message ID 1385480718-13702-1-git-send-email-sw@simonwunderlich.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Simon Wunderlich Nov. 26, 2013, 3:45 p.m. UTC
When external CSA IEs are received (beacons or action messages), a
channel switch is triggered as well. This should only be allowed on
devices which actually support channel switches, otherwise disconnect.
(For the corresponding userspace invocation, the wiphy flag is checked
in nl80211).

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/mac80211/ibss.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Johannes Berg Dec. 2, 2013, 10:54 a.m. UTC | #1
On Tue, 2013-11-26 at 16:45 +0100, Simon Wunderlich wrote:
> When external CSA IEs are received (beacons or action messages), a
> channel switch is triggered as well. This should only be allowed on
> devices which actually support channel switches, otherwise disconnect.
> (For the corresponding userspace invocation, the wiphy flag is checked
> in nl80211).

Applied.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 0f1fb5d..2eda7b1 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -823,6 +823,10 @@  ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
 	if (err)
 		return false;
 
+	/* channel switch is not supported, disconnect */
+	if (!(sdata->local->hw.wiphy->flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH))
+		goto disconnect;
+
 	params.count = csa_ie.count;
 	params.chandef = csa_ie.chandef;