Skip to content

Commit

Permalink
cfg80211: deauth doesn't always imply disconnect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 16, 2010
1 parent 2bff8eb commit 3f3b6a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand All @@ -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;

Expand Down

0 comments on commit 3f3b6a8

Please sign in to comment.