diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 84e59b9b493a..aca22b00b6a3 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1102,14 +1102,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1102 | struct sta_info *sta; | 1102 | struct sta_info *sta; |
1103 | u32 changed = 0, config_changed = 0; | 1103 | u32 changed = 0, config_changed = 0; |
1104 | 1104 | ||
1105 | rcu_read_lock(); | ||
1106 | |||
1107 | sta = sta_info_get(local, ifmgd->bssid); | ||
1108 | if (!sta) { | ||
1109 | rcu_read_unlock(); | ||
1110 | return; | ||
1111 | } | ||
1112 | |||
1113 | if (deauth) { | 1105 | if (deauth) { |
1114 | ifmgd->direct_probe_tries = 0; | 1106 | ifmgd->direct_probe_tries = 0; |
1115 | ifmgd->auth_tries = 0; | 1107 | ifmgd->auth_tries = 0; |
@@ -1120,7 +1112,11 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1120 | netif_tx_stop_all_queues(sdata->dev); | 1112 | netif_tx_stop_all_queues(sdata->dev); |
1121 | netif_carrier_off(sdata->dev); | 1113 | netif_carrier_off(sdata->dev); |
1122 | 1114 | ||
1123 | ieee80211_sta_tear_down_BA_sessions(sta); | 1115 | rcu_read_lock(); |
1116 | sta = sta_info_get(local, ifmgd->bssid); | ||
1117 | if (sta) | ||
1118 | ieee80211_sta_tear_down_BA_sessions(sta); | ||
1119 | rcu_read_unlock(); | ||
1124 | 1120 | ||
1125 | bss = ieee80211_rx_bss_get(local, ifmgd->bssid, | 1121 | bss = ieee80211_rx_bss_get(local, ifmgd->bssid, |
1126 | conf->channel->center_freq, | 1122 | conf->channel->center_freq, |
@@ -1156,8 +1152,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1156 | ifmgd->ssid, ifmgd->ssid_len); | 1152 | ifmgd->ssid, ifmgd->ssid_len); |
1157 | } | 1153 | } |
1158 | 1154 | ||
1159 | rcu_read_unlock(); | ||
1160 | |||
1161 | ieee80211_set_wmm_default(sdata); | 1155 | ieee80211_set_wmm_default(sdata); |
1162 | 1156 | ||
1163 | ieee80211_recalc_idle(local); | 1157 | ieee80211_recalc_idle(local); |
@@ -2487,6 +2481,10 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size | |||
2487 | ifmgd = &sdata->u.mgd; | 2481 | ifmgd = &sdata->u.mgd; |
2488 | 2482 | ||
2489 | if (ifmgd->ssid_len != len || memcmp(ifmgd->ssid, ssid, len) != 0) { | 2483 | if (ifmgd->ssid_len != len || memcmp(ifmgd->ssid, ssid, len) != 0) { |
2484 | if (ifmgd->state == IEEE80211_STA_MLME_ASSOCIATED) | ||
2485 | ieee80211_set_disassoc(sdata, true, true, | ||
2486 | WLAN_REASON_DEAUTH_LEAVING); | ||
2487 | |||
2490 | /* | 2488 | /* |
2491 | * Do not use reassociation if SSID is changed (different ESS). | 2489 | * Do not use reassociation if SSID is changed (different ESS). |
2492 | */ | 2490 | */ |
@@ -2511,6 +2509,11 @@ int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid) | |||
2511 | { | 2509 | { |
2512 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2510 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2513 | 2511 | ||
2512 | if (compare_ether_addr(bssid, ifmgd->bssid) != 0 && | ||
2513 | ifmgd->state == IEEE80211_STA_MLME_ASSOCIATED) | ||
2514 | ieee80211_set_disassoc(sdata, true, true, | ||
2515 | WLAN_REASON_DEAUTH_LEAVING); | ||
2516 | |||
2514 | if (is_valid_ether_addr(bssid)) { | 2517 | if (is_valid_ether_addr(bssid)) { |
2515 | memcpy(ifmgd->bssid, bssid, ETH_ALEN); | 2518 | memcpy(ifmgd->bssid, bssid, ETH_ALEN); |
2516 | ifmgd->flags |= IEEE80211_STA_BSSID_SET; | 2519 | ifmgd->flags |= IEEE80211_STA_BSSID_SET; |