Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171877
b: refs/heads/master
c: 24b6b15
h: refs/heads/master
i:
  171875: dc326f4
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Nov 18, 2009
1 parent 309c820 commit e39db56
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af65cd96dd4ea8ea5adc6ee850e61a407cd1067a
refs/heads/master: 24b6b15f7d07d26330f73057d618089976a08792
20 changes: 18 additions & 2 deletions trunk/net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,23 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
struct cfg80211_assoc_request req;
struct cfg80211_internal_bss *bss;
int i, err, slot = -1;
bool was_connected = false;

ASSERT_WDEV_LOCK(wdev);

memset(&req, 0, sizeof(req));

if (wdev->current_bss)
if (wdev->current_bss && prev_bssid &&
memcmp(wdev->current_bss->pub.bssid, prev_bssid, ETH_ALEN) == 0) {
/*
* Trying to reassociate: Allow this to proceed and let the old
* association to be dropped when the new one is completed.
*/
if (wdev->sme_state == CFG80211_SME_CONNECTED) {
was_connected = true;
wdev->sme_state = CFG80211_SME_CONNECTING;
}
} else if (wdev->current_bss)
return -EALREADY;

req.ie = ie;
Expand All @@ -461,8 +472,11 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
req.prev_bssid = prev_bssid;
req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!req.bss)
if (!req.bss) {
if (was_connected)
wdev->sme_state = CFG80211_SME_CONNECTED;
return -ENOENT;
}

bss = bss_from_pub(req.bss);

Expand All @@ -480,6 +494,8 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,

err = rdev->ops->assoc(&rdev->wiphy, dev, &req);
out:
if (err && was_connected)
wdev->sme_state = CFG80211_SME_CONNECTED;
/* still a reference in wdev->auth_bsses[slot] */
cfg80211_put_bss(req.bss);
return err;
Expand Down

0 comments on commit e39db56

Please sign in to comment.