aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f1a80da4e56a..aa69a331f374 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1324,7 +1324,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1324 struct ieee80211_local *local = sdata->local; 1324 struct ieee80211_local *local = sdata->local;
1325 struct sta_info *sta; 1325 struct sta_info *sta;
1326 u32 changed = 0; 1326 u32 changed = 0;
1327 u8 bssid[ETH_ALEN];
1328 1327
1329 ASSERT_MGD_MTX(ifmgd); 1328 ASSERT_MGD_MTX(ifmgd);
1330 1329
@@ -1336,10 +1335,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1336 1335
1337 ieee80211_stop_poll(sdata); 1336 ieee80211_stop_poll(sdata);
1338 1337
1339 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1340
1341 ifmgd->associated = NULL; 1338 ifmgd->associated = NULL;
1342 memset(ifmgd->bssid, 0, ETH_ALEN);
1343 1339
1344 /* 1340 /*
1345 * we need to commit the associated = NULL change because the 1341 * we need to commit the associated = NULL change because the
@@ -1359,7 +1355,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1359 netif_carrier_off(sdata->dev); 1355 netif_carrier_off(sdata->dev);
1360 1356
1361 mutex_lock(&local->sta_mtx); 1357 mutex_lock(&local->sta_mtx);
1362 sta = sta_info_get(sdata, bssid); 1358 sta = sta_info_get(sdata, ifmgd->bssid);
1363 if (sta) { 1359 if (sta) {
1364 set_sta_flag(sta, WLAN_STA_BLOCK_BA); 1360 set_sta_flag(sta, WLAN_STA_BLOCK_BA);
1365 ieee80211_sta_tear_down_BA_sessions(sta, tx); 1361 ieee80211_sta_tear_down_BA_sessions(sta, tx);
@@ -1368,13 +1364,16 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1368 1364
1369 /* deauthenticate/disassociate now */ 1365 /* deauthenticate/disassociate now */
1370 if (tx || frame_buf) 1366 if (tx || frame_buf)
1371 ieee80211_send_deauth_disassoc(sdata, bssid, stype, reason, 1367 ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid, stype,
1372 tx, frame_buf); 1368 reason, tx, frame_buf);
1373 1369
1374 /* flush out frame */ 1370 /* flush out frame */
1375 if (tx) 1371 if (tx)
1376 drv_flush(local, false); 1372 drv_flush(local, false);
1377 1373
1374 /* clear bssid only after building the needed mgmt frames */
1375 memset(ifmgd->bssid, 0, ETH_ALEN);
1376
1378 /* remove AP and TDLS peers */ 1377 /* remove AP and TDLS peers */
1379 sta_info_flush(local, sdata); 1378 sta_info_flush(local, sdata);
1380 1379
@@ -2153,15 +2152,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2153 mgmt->sa, status_code); 2152 mgmt->sa, status_code);
2154 ieee80211_destroy_assoc_data(sdata, false); 2153 ieee80211_destroy_assoc_data(sdata, false);
2155 } else { 2154 } else {
2156 sdata_info(sdata, "associated\n");
2157
2158 if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { 2155 if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) {
2159 /* oops -- internal error -- send timeout for now */ 2156 /* oops -- internal error -- send timeout for now */
2160 ieee80211_destroy_assoc_data(sdata, true); 2157 ieee80211_destroy_assoc_data(sdata, false);
2161 sta_info_destroy_addr(sdata, mgmt->bssid);
2162 cfg80211_put_bss(*bss); 2158 cfg80211_put_bss(*bss);
2163 return RX_MGMT_CFG80211_ASSOC_TIMEOUT; 2159 return RX_MGMT_CFG80211_ASSOC_TIMEOUT;
2164 } 2160 }
2161 sdata_info(sdata, "associated\n");
2165 2162
2166 /* 2163 /*
2167 * destroy assoc_data afterwards, as otherwise an idle 2164 * destroy assoc_data afterwards, as otherwise an idle