Commit 9c87ba67 authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

mac80211: Fix reassociation processing (within ESS roaming)

Commit e1dd33f60ced091114e4aacf141e0d03b88d3e13 changed cfg80211 to
allow association commands while in associated state to enable support
for roaming within an ESS. However, this was not enough to resolve all
cases with mac80211 which needs some additional handling of the
reassociation case to clear internal state with the BSS that was in use
previously.

This patch makes ieee80211_mgd_assoc() accept a valid reassociation
command and clean the association state with the previous BSS. This
fixes roaming between BSSes in an ESS when using wpa_supplicant with
-Dnl80211.
Signed-off-by: default avatarJouni Malinen <j@w1.fi>
Cc: stable@kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a9f042cb
...@@ -1893,9 +1893,21 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -1893,9 +1893,21 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
mutex_lock(&ifmgd->mtx); mutex_lock(&ifmgd->mtx);
if (ifmgd->associated) { if (ifmgd->associated) {
if (!req->prev_bssid ||
memcmp(req->prev_bssid, ifmgd->associated->bssid,
ETH_ALEN)) {
/*
* We are already associated and the request was not a
* reassociation request from the current BSS, so
* reject it.
*/
mutex_unlock(&ifmgd->mtx); mutex_unlock(&ifmgd->mtx);
return -EALREADY; return -EALREADY;
} }
/* Trying to reassociate - clear previous association state */
ieee80211_set_disassoc(sdata);
}
mutex_unlock(&ifmgd->mtx); mutex_unlock(&ifmgd->mtx);
wk = kzalloc(sizeof(*wk) + req->ie_len, GFP_KERNEL); wk = kzalloc(sizeof(*wk) + req->ie_len, GFP_KERNEL);
......
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