From e43b1e2cb5f73fb10e7f56f6a97dff55eeb63d6c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Feb 2010 12:13:46 +0200 Subject: [PATCH] --- yaml --- r: 187916 b: refs/heads/master c: 9c87ba6734422034fccb938da1039ed63da1395c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/mac80211/mlme.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4d2dcbcf0715..3473a2bd5382 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a9f042cbe5284f34ccff15f3084477e11b39b17b +refs/heads/master: 9c87ba6734422034fccb938da1039ed63da1395c diff --git a/trunk/net/mac80211/mlme.c b/trunk/net/mac80211/mlme.c index 41812a15eea0..5a268761e4c5 100644 --- a/trunk/net/mac80211/mlme.c +++ b/trunk/net/mac80211/mlme.c @@ -1893,8 +1893,20 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, mutex_lock(&ifmgd->mtx); if (ifmgd->associated) { - mutex_unlock(&ifmgd->mtx); - return -EALREADY; + 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); + return -EALREADY; + } + + /* Trying to reassociate - clear previous association state */ + ieee80211_set_disassoc(sdata); } mutex_unlock(&ifmgd->mtx);