diff options
-rw-r--r-- | net/mac80211/mlme.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 41812a15eea0..5a268761e4c5 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1893,8 +1893,20 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
1893 | 1893 | ||
1894 | mutex_lock(&ifmgd->mtx); | 1894 | mutex_lock(&ifmgd->mtx); |
1895 | if (ifmgd->associated) { | 1895 | if (ifmgd->associated) { |
1896 | mutex_unlock(&ifmgd->mtx); | 1896 | if (!req->prev_bssid || |
1897 | return -EALREADY; | 1897 | memcmp(req->prev_bssid, ifmgd->associated->bssid, |
1898 | ETH_ALEN)) { | ||
1899 | /* | ||
1900 | * We are already associated and the request was not a | ||
1901 | * reassociation request from the current BSS, so | ||
1902 | * reject it. | ||
1903 | */ | ||
1904 | mutex_unlock(&ifmgd->mtx); | ||
1905 | return -EALREADY; | ||
1906 | } | ||
1907 | |||
1908 | /* Trying to reassociate - clear previous association state */ | ||
1909 | ieee80211_set_disassoc(sdata); | ||
1898 | } | 1910 | } |
1899 | mutex_unlock(&ifmgd->mtx); | 1911 | mutex_unlock(&ifmgd->mtx); |
1900 | 1912 | ||