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

mac80211: Fix reassociation by not clearing previous BSSID

We must not clear the previous BSSID when roaming to another AP within
the same ESS for reassociation to be used properly. It is fine to
clear this when the SSID changes, so let's move the code into
ieee80211_sta_set_ssid().
Signed-off-by: default avatarJouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4b4698c4
...@@ -1888,8 +1888,6 @@ int ieee80211_sta_commit(struct ieee80211_sub_if_data *sdata) ...@@ -1888,8 +1888,6 @@ int ieee80211_sta_commit(struct ieee80211_sub_if_data *sdata)
{ {
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
if (ifmgd->ssid_len) if (ifmgd->ssid_len)
ifmgd->flags |= IEEE80211_STA_SSID_SET; ifmgd->flags |= IEEE80211_STA_SSID_SET;
else else
...@@ -1908,6 +1906,10 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size ...@@ -1908,6 +1906,10 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size
ifmgd = &sdata->u.mgd; ifmgd = &sdata->u.mgd;
if (ifmgd->ssid_len != len || memcmp(ifmgd->ssid, ssid, len) != 0) { if (ifmgd->ssid_len != len || memcmp(ifmgd->ssid, ssid, len) != 0) {
/*
* Do not use reassociation if SSID is changed (different ESS).
*/
ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
memset(ifmgd->ssid, 0, sizeof(ifmgd->ssid)); memset(ifmgd->ssid, 0, sizeof(ifmgd->ssid));
memcpy(ifmgd->ssid, ssid, len); memcpy(ifmgd->ssid, ssid, len);
ifmgd->ssid_len = len; ifmgd->ssid_len = len;
......
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