aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/wireless/mlme.c9
-rw-r--r--net/wireless/sme.c22
2 files changed, 15 insertions, 16 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index da64071ceb84..79d2eec54cec 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -96,6 +96,15 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
96 WARN_ON(!bss); 96 WARN_ON(!bss);
97 } 97 }
98 98
99 if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) {
100 /*
101 * This is for the userspace SME, the CONNECTING
102 * state will be changed to CONNECTED by
103 * __cfg80211_connect_result() below.
104 */
105 wdev->sme_state = CFG80211_SME_CONNECTING;
106 }
107
99 /* this consumes one bss reference (unless bss is NULL) */ 108 /* this consumes one bss reference (unless bss is NULL) */
100 __cfg80211_connect_result(dev, mgmt->bssid, NULL, 0, ie, len - ieoffs, 109 __cfg80211_connect_result(dev, mgmt->bssid, NULL, 0, ie, len - ieoffs,
101 status_code, 110 status_code,
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 8e2ef54ea714..6fb6a704ca40 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -351,15 +351,13 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
351 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION)) 351 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
352 return; 352 return;
353 353
354 if (wdev->sme_state == CFG80211_SME_CONNECTED) 354 if (WARN_ON(wdev->sme_state != CFG80211_SME_CONNECTING))
355 nl80211_send_roamed(wiphy_to_dev(wdev->wiphy), dev, 355 return;
356
357 nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev,
356 bssid, req_ie, req_ie_len, 358 bssid, req_ie, req_ie_len,
357 resp_ie, resp_ie_len, GFP_KERNEL); 359 resp_ie, resp_ie_len,
358 else 360 status, GFP_KERNEL);
359 nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev,
360 bssid, req_ie, req_ie_len,
361 resp_ie, resp_ie_len,
362 status, GFP_KERNEL);
363 361
364#ifdef CONFIG_WIRELESS_EXT 362#ifdef CONFIG_WIRELESS_EXT
365 if (wextev) { 363 if (wextev) {
@@ -392,13 +390,6 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
392 wdev->current_bss = NULL; 390 wdev->current_bss = NULL;
393 } 391 }
394 392
395 if (status == WLAN_STATUS_SUCCESS &&
396 wdev->sme_state == CFG80211_SME_IDLE)
397 goto success;
398
399 if (wdev->sme_state != CFG80211_SME_CONNECTING)
400 return;
401
402 if (wdev->conn) 393 if (wdev->conn)
403 wdev->conn->state = CFG80211_CONN_IDLE; 394 wdev->conn->state = CFG80211_CONN_IDLE;
404 395
@@ -412,7 +403,6 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
412 return; 403 return;
413 } 404 }
414 405
415 success:
416 if (!bss) 406 if (!bss)
417 bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, 407 bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
418 wdev->ssid, wdev->ssid_len, 408 wdev->ssid, wdev->ssid_len,