diff options
author | Eliad Peller <eliad@wizery.com> | 2012-07-02 07:42:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 15:01:00 -0400 |
commit | 10a9109f2705fdc3caa94d768b2559587a9a050c (patch) | |
tree | 53d4a010c1bebc88af00c7f17b188c6150907bd2 /net | |
parent | 147f20e316f3949f3f5ffe6c8658e9fe1c6ceb23 (diff) |
mac80211: destroy assoc_data correctly if assoc fails
If association failed due to internal error (e.g. no
supported rates IE), we call ieee80211_destroy_assoc_data()
with assoc=true, while we actually reject the association.
This results in the BSSID not being zeroed out.
After passing assoc=false, we no longer have to call
sta_info_destroy_addr() explicitly. While on it, move
the "associated" message after the assoc_success check.
Cc: stable@vger.kernel.org [3.4+]
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a4bb856de08f..0db5d34a06b6 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2174,15 +2174,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2174 | sdata->name, mgmt->sa, status_code); | 2174 | sdata->name, mgmt->sa, status_code); |
2175 | ieee80211_destroy_assoc_data(sdata, false); | 2175 | ieee80211_destroy_assoc_data(sdata, false); |
2176 | } else { | 2176 | } else { |
2177 | printk(KERN_DEBUG "%s: associated\n", sdata->name); | ||
2178 | |||
2179 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { | 2177 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { |
2180 | /* oops -- internal error -- send timeout for now */ | 2178 | /* oops -- internal error -- send timeout for now */ |
2181 | ieee80211_destroy_assoc_data(sdata, true); | 2179 | ieee80211_destroy_assoc_data(sdata, false); |
2182 | sta_info_destroy_addr(sdata, mgmt->bssid); | ||
2183 | cfg80211_put_bss(*bss); | 2180 | cfg80211_put_bss(*bss); |
2184 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; | 2181 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; |
2185 | } | 2182 | } |
2183 | printk(KERN_DEBUG "%s: associated\n", sdata->name); | ||
2186 | 2184 | ||
2187 | /* | 2185 | /* |
2188 | * destroy assoc_data afterwards, as otherwise an idle | 2186 | * destroy assoc_data afterwards, as otherwise an idle |