mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
wifi: cfg80211: track SSID regardless of country data
If the country data cannot be found, the function exits
and then doesn't track the SSID. Move the SSID tracking
up to fix that.
Fixes: c38c701851 ("wifi: cfg80211: Set SSID if it is not already set")
Link: https://patch.msgid.link/20261013151258.7fbca481c328.I7beb03fb4309698bdcfade57c6804573f96eeb18@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
a919316bbb
commit
577f690ce5
|
|
@ -872,6 +872,25 @@ void __cfg80211_connect_result(struct net_device *dev,
|
|||
|
||||
cfg80211_upload_connect_keys(wdev);
|
||||
|
||||
if (!wdev->u.client.ssid_len) {
|
||||
rcu_read_lock();
|
||||
for_each_valid_link(cr, link) {
|
||||
u32 ssid_len;
|
||||
|
||||
ssid = ieee80211_bss_get_elem(cr->links[link].bss,
|
||||
WLAN_EID_SSID);
|
||||
|
||||
if (!ssid || !ssid->datalen)
|
||||
continue;
|
||||
|
||||
ssid_len = min(ssid->datalen, IEEE80211_MAX_SSID_LEN);
|
||||
memcpy(wdev->u.client.ssid, ssid->data, ssid_len);
|
||||
wdev->u.client.ssid_len = ssid_len;
|
||||
break;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_valid_link(cr, link) {
|
||||
country_elem =
|
||||
|
|
@ -897,25 +916,6 @@ void __cfg80211_connect_result(struct net_device *dev,
|
|||
country_data, country_datalen);
|
||||
kfree(country_data);
|
||||
|
||||
if (!wdev->u.client.ssid_len) {
|
||||
rcu_read_lock();
|
||||
for_each_valid_link(cr, link) {
|
||||
u32 ssid_len;
|
||||
|
||||
ssid = ieee80211_bss_get_elem(cr->links[link].bss,
|
||||
WLAN_EID_SSID);
|
||||
|
||||
if (!ssid || !ssid->datalen)
|
||||
continue;
|
||||
|
||||
ssid_len = min(ssid->datalen, IEEE80211_MAX_SSID_LEN);
|
||||
memcpy(wdev->u.client.ssid, ssid->data, ssid_len);
|
||||
wdev->u.client.ssid_len = ssid_len;
|
||||
break;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
return;
|
||||
out:
|
||||
for_each_valid_link(cr, link)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user