diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/mlme.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 1a92bf7597bf..020f33b38467 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -278,6 +278,21 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, | |||
278 | struct cfg80211_internal_bss *bss; | 278 | struct cfg80211_internal_bss *bss; |
279 | int i, err, slot = -1, nfree = 0; | 279 | int i, err, slot = -1, nfree = 0; |
280 | 280 | ||
281 | if (wdev->current_bss && | ||
282 | memcmp(bssid, wdev->current_bss->pub.bssid, ETH_ALEN) == 0) | ||
283 | return -EALREADY; | ||
284 | |||
285 | for (i = 0; i < MAX_AUTH_BSSES; i++) { | ||
286 | if (wdev->authtry_bsses[i] && | ||
287 | memcmp(bssid, wdev->authtry_bsses[i]->pub.bssid, | ||
288 | ETH_ALEN) == 0) | ||
289 | return -EALREADY; | ||
290 | if (wdev->auth_bsses[i] && | ||
291 | memcmp(bssid, wdev->auth_bsses[i]->pub.bssid, | ||
292 | ETH_ALEN) == 0) | ||
293 | return -EALREADY; | ||
294 | } | ||
295 | |||
281 | memset(&req, 0, sizeof(req)); | 296 | memset(&req, 0, sizeof(req)); |
282 | 297 | ||
283 | req.ie = ie; | 298 | req.ie = ie; |
@@ -291,13 +306,6 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, | |||
291 | bss = bss_from_pub(req.bss); | 306 | bss = bss_from_pub(req.bss); |
292 | 307 | ||
293 | for (i = 0; i < MAX_AUTH_BSSES; i++) { | 308 | for (i = 0; i < MAX_AUTH_BSSES; i++) { |
294 | if (bss == wdev->auth_bsses[i]) { | ||
295 | err = -EALREADY; | ||
296 | goto out; | ||
297 | } | ||
298 | } | ||
299 | |||
300 | for (i = 0; i < MAX_AUTH_BSSES; i++) { | ||
301 | if (!wdev->auth_bsses[i] && !wdev->authtry_bsses[i]) { | 309 | if (!wdev->auth_bsses[i] && !wdev->authtry_bsses[i]) { |
302 | slot = i; | 310 | slot = i; |
303 | nfree++; | 311 | nfree++; |