Commit 10a9109f authored by Eliad Peller's avatar Eliad Peller Committed by John W. Linville

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: default avatarEliad Peller <eliad@wizery.com>
Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 147f20e3
...@@ -2174,15 +2174,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, ...@@ -2174,15 +2174,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
sdata->name, mgmt->sa, status_code); sdata->name, mgmt->sa, status_code);
ieee80211_destroy_assoc_data(sdata, false); ieee80211_destroy_assoc_data(sdata, false);
} else { } else {
printk(KERN_DEBUG "%s: associated\n", sdata->name);
if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) {
/* oops -- internal error -- send timeout for now */ /* oops -- internal error -- send timeout for now */
ieee80211_destroy_assoc_data(sdata, true); ieee80211_destroy_assoc_data(sdata, false);
sta_info_destroy_addr(sdata, mgmt->bssid);
cfg80211_put_bss(*bss); cfg80211_put_bss(*bss);
return RX_MGMT_CFG80211_ASSOC_TIMEOUT; return RX_MGMT_CFG80211_ASSOC_TIMEOUT;
} }
printk(KERN_DEBUG "%s: associated\n", sdata->name);
/* /*
* destroy assoc_data afterwards, as otherwise an idle * destroy assoc_data afterwards, as otherwise an idle
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment