fix issues with wifi ssd reassociations
This commit is contained in:
parent
081258e8c0
commit
fd22a2ae30
|
@ -522,11 +522,6 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (wdev->current_bss) {
|
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_unhold_bss(wdev->current_bss);
|
||||||
cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
|
cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub);
|
||||||
wdev->current_bss = NULL;
|
wdev->current_bss = NULL;
|
||||||
|
@ -694,6 +689,11 @@ void __cfg80211_connect_result(struct net_device *dev,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (WARN_ON(!wdev->ssid_len)) {
|
||||||
|
cfg80211_put_bss(wdev->wiphy, cr->bss);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, cr,
|
nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, cr,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
||||||
|
@ -1063,11 +1063,35 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
|
||||||
|
|
||||||
ASSERT_WDEV_LOCK(wdev);
|
ASSERT_WDEV_LOCK(wdev);
|
||||||
|
|
||||||
if (WARN_ON(wdev->connect_keys)) {
|
/*
|
||||||
kzfree(wdev->connect_keys);
|
* If we have an ssid_len, we're trying to connect or are
|
||||||
wdev->connect_keys = NULL;
|
* already connected, so reject a new SSID unless it's the
|
||||||
|
* same (which is the case for Re-Association.
|
||||||
|
*/
|
||||||
|
if (wdev->ssid_len &&
|
||||||
|
(wdev->ssid_len != connect->ssid_len ||
|
||||||
|
memcmp(wdev->ssid, connect->ssid, wdev->ssid_len)))
|
||||||
|
return -EALREADY;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If connected, reject (re-)association unless prev_bssid
|
||||||
|
* matches the current BSSID.
|
||||||
|
*/
|
||||||
|
if (wdev->current_bss) {
|
||||||
|
if (!prev_bssid)
|
||||||
|
return -EALREADY;
|
||||||
|
if (!ether_addr_equal(prev_bssid, wdev->current_bss->pub.bssid))
|
||||||
|
return -ENOTCONN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reject if we're in the process of connecting with WEP,
|
||||||
|
* this case isn't very interesting and trying to handle
|
||||||
|
* it would make the code much more complex.
|
||||||
|
*/
|
||||||
|
if (wdev->connect_keys)
|
||||||
|
return -EINPROGRESS;
|
||||||
|
|
||||||
cfg80211_oper_and_ht_capa(&connect->ht_capa_mask,
|
cfg80211_oper_and_ht_capa(&connect->ht_capa_mask,
|
||||||
rdev->wiphy.ht_capa_mod_mask);
|
rdev->wiphy.ht_capa_mod_mask);
|
||||||
|
|
||||||
|
@ -1118,7 +1142,12 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
wdev->connect_keys = NULL;
|
wdev->connect_keys = NULL;
|
||||||
wdev->ssid_len = 0;
|
/*
|
||||||
|
* This could be reassoc getting refused, don't clear
|
||||||
|
* ssid_len in that case.
|
||||||
|
*/
|
||||||
|
if (!wdev->current_bss)
|
||||||
|
wdev->ssid_len = 0;
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1145,6 +1174,14 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
|
||||||
else if (wdev->ssid_len)
|
else if (wdev->ssid_len)
|
||||||
err = rdev_disconnect(rdev, dev, reason);
|
err = rdev_disconnect(rdev, dev, reason);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clear ssid_len unless we actually were fully connected,
|
||||||
|
* in which case cfg80211_disconnected() will take care of
|
||||||
|
* this later.
|
||||||
|
*/
|
||||||
|
if (!wdev->current_bss)
|
||||||
|
wdev->ssid_len = 0;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue