linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: prevent authentication on channel mismatch w/ hw conf
@ 2011-04-04 17:24 Rajkumar Manoharan
  2011-04-04 18:16 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Rajkumar Manoharan @ 2011-04-04 17:24 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Rajkumar Manoharan

Do not proceed authentication if hw was already configured
with one of the vif's channel which is differed with requesting
channel. Not doing so is causing unneccesary dissociation.
This issue was originaly found while testing concurrent mode
with p2p vif.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
 net/mac80211/mlme.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 64d92d5..dcf3d6f 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2282,11 +2282,30 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
 {
 	const u8 *ssid;
 	struct ieee80211_work *wk;
+	struct ieee80211_sub_if_data *ifdata;
+	bool found = false;
 	u16 auth_alg;
 
 	if (req->local_state_change)
 		return 0; /* no need to update mac80211 state */
 
+	/*
+	 * XXX: hw conf check should be removed, once the multiple
+	 * channels are supported by mac80211
+	 */
+	mutex_lock(&sdata->local->iflist_mtx);
+	list_for_each_entry(ifdata, &sdata->local->interfaces, list) {
+		if (ifdata->vif.bss_conf.enable_beacon ||
+		    ifdata->vif.bss_conf.assoc) {
+			found = true;
+			break;
+		}
+	}
+	mutex_unlock(&sdata->local->iflist_mtx);
+
+	if (found && (sdata->local->hw.conf.channel != req->bss->channel))
+		return -EOPNOTSUPP;
+
 	switch (req->auth_type) {
 	case NL80211_AUTHTYPE_OPEN_SYSTEM:
 		auth_alg = WLAN_AUTH_OPEN;
-- 
1.7.4.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-05 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04 17:24 [RFC] mac80211: prevent authentication on channel mismatch w/ hw conf Rajkumar Manoharan
2011-04-04 18:16 ` Johannes Berg
2011-04-05 15:18   ` Rajkumar Manoharan
2011-04-05 15:20     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).