summaryrefslogtreecommitdiff
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-03-29 13:53:28 +0300
committerJohannes Berg <johannes.berg@intel.com>2016-04-06 16:09:28 +0300
commit4ce2bd9c4c1dfb416206ff1ad5283f6d24af4031 (patch)
treebda1737b572117dbe5fdf04d6aa15cfae24c63ce /net/wireless/sme.c
parentba6fbacf9c073effaedf0c52fe7e52e2baf67725 (diff)
downloadlinux-4ce2bd9c4c1dfb416206ff1ad5283f6d24af4031.tar.xz
cfg80211: Allow reassociation to be requested with internal SME
If the user space issues a NL80211_CMD_CONNECT with NL80211_ATTR_PREV_BSSID when there is already a connection, allow this to proceed as a reassociation instead of rejecting the new connect command with EALREADY. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> [validate prev_bssid] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 65882d2777c0..1fba41676428 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -492,8 +492,18 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,
if (!rdev->ops->auth || !rdev->ops->assoc)
return -EOPNOTSUPP;
- if (wdev->current_bss)
- return -EALREADY;
+ if (wdev->current_bss) {
+ if (!prev_bssid)
+ return -EALREADY;
+ if (prev_bssid &&
+ !ether_addr_equal(prev_bssid, wdev->current_bss->pub.bssid))
+ return -ENOTCONN;
+ cfg80211_unhold_bss(wdev->current_bss);
+ cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
+ wdev->current_bss = NULL;
+
+ cfg80211_sme_free(wdev);
+ }
if (WARN_ON(wdev->conn))
return -EINPROGRESS;