Search Linux Wireless

[RFC] mac80211: prevent authentication on channel mismatch w/ hw conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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

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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux