diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-09-30 14:11:32 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2021-11-28 23:53:04 +0300 |
commit | fb8b53acf60bdfcefc5a583ce2946258f8261108 (patch) | |
tree | ed23b5fd7420185df95df50a1a29ee337bbaf7e7 /net/wireless/nl80211.c | |
parent | fb5f6a0e8063b7a84d6d44ef353846ccd7708d2e (diff) | |
download | linux-fb8b53acf60bdfcefc5a583ce2946258f8261108.tar.xz |
cfg80211: use ieee80211_bss_get_elem() instead of _get_ie()
Use the structured helper for finding an element instead of
the unstructured ieee80211_bss_get_ie().
Link: https://lore.kernel.org/r/20210930131130.e94709f341c3.I4ddb7fcb40efca27987deda7f9a144a5702ebfae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 65693c96b407..bfa5d7428a3f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3670,14 +3670,16 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_ADHOC: { - const u8 *ssid_ie; + const struct element *ssid_elem; + if (!wdev->current_bss) break; rcu_read_lock(); - ssid_ie = ieee80211_bss_get_ie(&wdev->current_bss->pub, - WLAN_EID_SSID); - if (ssid_ie && - nla_put(msg, NL80211_ATTR_SSID, ssid_ie[1], ssid_ie + 2)) + ssid_elem = ieee80211_bss_get_elem(&wdev->current_bss->pub, + WLAN_EID_SSID); + if (ssid_elem && + nla_put(msg, NL80211_ATTR_SSID, ssid_elem->datalen, + ssid_elem->data)) goto nla_put_failure_rcu_locked; rcu_read_unlock(); break; |