summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-05 10:20:27 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 15:26:39 -0400
commit3f3b6a8d90b6e762e2bb83e6a9e86d9534b56cdc (patch)
tree6d9580c04474055b06d6b5c332c8f3d36c8a3bbc
parent2bff8ebf32a7c5ec9e5f5eeffef94a8cb622f5f0 (diff)
downloadop-kernel-dev-3f3b6a8d90b6e762e2bb83e6a9e86d9534b56cdc.zip
op-kernel-dev-3f3b6a8d90b6e762e2bb83e6a9e86d9534b56cdc.tar.gz
cfg80211: deauth doesn't always imply disconnect
When an AP sends a deauth frame, or we send one to an AP, that only means we lost our connection if we were actually connected to that AP. Check this to avoid sending spurious "disconnected" events and breaking "iw ... link" reporting. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/wireless/mlme.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index d1a3fb9..ee0af32 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -149,7 +149,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;
const u8 *bssid = mgmt->bssid;
int i;
- bool found = false;
+ bool found = false, was_current = false;
ASSERT_WDEV_LOCK(wdev);
@@ -159,6 +159,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
cfg80211_put_bss(&wdev->current_bss->pub);
wdev->current_bss = NULL;
found = true;
+ was_current = true;
} else for (i = 0; i < MAX_AUTH_BSSES; i++) {
if (wdev->auth_bsses[i] &&
memcmp(wdev->auth_bsses[i]->pub.bssid, bssid, ETH_ALEN) == 0) {
@@ -183,7 +184,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
nl80211_send_deauth(rdev, dev, buf, len, GFP_KERNEL);
- if (wdev->sme_state == CFG80211_SME_CONNECTED) {
+ if (wdev->sme_state == CFG80211_SME_CONNECTED && was_current) {
u16 reason_code;
bool from_ap;
OpenPOWER on IntegriCloud