diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-08-06 14:41:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:12:47 -0400 |
commit | b6f0b639089fb160b10984ac56e07e7043dabad7 (patch) | |
tree | a0f1b09c77be822d41df7d26772e1e3b57ad63fe /net/wireless/sme.c | |
parent | e458b8a22d33eef62765c9f89889efeb4041f073 (diff) |
cfg80211: fix SME association after disassociation
When an AP disassociates us, we currently go into a weird
state because the SME doesn't handle authenticated but not
associated well unless it's within its own state machine,
it can't recover from that. However, it shouldn't need to,
since we don't do any decisions in it really -- so when we
get disconnected, simply deauthenticate too.
Reported-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r-- | net/wireless/sme.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 8a7dcbf90602..0b776b769c0f 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -570,10 +570,30 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, | |||
570 | wdev->ssid_len = 0; | 570 | wdev->ssid_len = 0; |
571 | 571 | ||
572 | if (wdev->conn) { | 572 | if (wdev->conn) { |
573 | const u8 *bssid; | ||
574 | int ret; | ||
575 | |||
573 | kfree(wdev->conn->ie); | 576 | kfree(wdev->conn->ie); |
574 | wdev->conn->ie = NULL; | 577 | wdev->conn->ie = NULL; |
575 | kfree(wdev->conn); | 578 | kfree(wdev->conn); |
576 | wdev->conn = NULL; | 579 | wdev->conn = NULL; |
580 | |||
581 | /* | ||
582 | * If this disconnect was due to a disassoc, we | ||
583 | * we might still have an auth BSS around. For | ||
584 | * the userspace SME that's currently expected, | ||
585 | * but for the kernel SME (nl80211 CONNECT or | ||
586 | * wireless extensions) we want to clear up all | ||
587 | * state. | ||
588 | */ | ||
589 | for (i = 0; i < MAX_AUTH_BSSES; i++) { | ||
590 | if (!wdev->auth_bsses[i]) | ||
591 | continue; | ||
592 | bssid = wdev->auth_bsses[i]->pub.bssid; | ||
593 | ret = __cfg80211_mlme_deauth(rdev, dev, bssid, NULL, 0, | ||
594 | WLAN_REASON_DEAUTH_LEAVING); | ||
595 | WARN(ret, "deauth failed: %d\n", ret); | ||
596 | } | ||
577 | } | 597 | } |
578 | 598 | ||
579 | nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap); | 599 | nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap); |