2009-03-19 11:48:13

by Jouni Malinen

[permalink] [raw]
Subject: [PATCH 2/4] 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: Jouni Malinen <[email protected]>

---
net/mac80211/mlme.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--- uml.orig/net/mac80211/mlme.c 2009-03-19 00:20:04.000000000 +0200
+++ uml/net/mac80211/mlme.c 2009-03-19 00:20:52.000000000 +0200
@@ -1888,8 +1888,6 @@ int ieee80211_sta_commit(struct ieee8021
{
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;

- ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
-
if (ifmgd->ssid_len)
ifmgd->flags |= IEEE80211_STA_SSID_SET;
else
@@ -1908,6 +1906,10 @@ int ieee80211_sta_set_ssid(struct ieee80
ifmgd = &sdata->u.mgd;

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));
memcpy(ifmgd->ssid, ssid, len);
ifmgd->ssid_len = len;

--

--
Jouni Malinen PGP id EFC895FA


2009-03-19 18:45:40

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 2/4] mac80211: Fix reassociation by not clearing previous BSSID

On Thu, 2009-03-19 at 13:39 +0200, Jouni Malinen wrote:
> plain text document attachment (mac80211-reassoc-fix.patch)
> 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: Jouni Malinen <[email protected]>

Acked-by: Johannes Berg <[email protected]>

> ---
> net/mac80211/mlme.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- uml.orig/net/mac80211/mlme.c 2009-03-19 00:20:04.000000000 +0200
> +++ uml/net/mac80211/mlme.c 2009-03-19 00:20:52.000000000 +0200
> @@ -1888,8 +1888,6 @@ int ieee80211_sta_commit(struct ieee8021
> {
> struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
>
> - ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
> -
> if (ifmgd->ssid_len)
> ifmgd->flags |= IEEE80211_STA_SSID_SET;
> else
> @@ -1908,6 +1906,10 @@ int ieee80211_sta_set_ssid(struct ieee80
> ifmgd = &sdata->u.mgd;
>
> 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));
> memcpy(ifmgd->ssid, ssid, len);
> ifmgd->ssid_len = len;
>
> --
>


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part