From: Johannes Berg <johannes@sipsolutions.net>
To: Wen Gong <wgong@codeaurora.org>, ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v4 5/6] mac80211: use ieee802_11_parse_elems() to find ies instead of ieee80211_bss_get_ie()
Date: Fri, 24 Sep 2021 12:13:36 +0200 [thread overview]
Message-ID: <b02735cc844c9ba2222d23a7e6ad112a82a36891.camel@sipsolutions.net> (raw)
In-Reply-To: <20210924100052.32029-6-wgong@codeaurora.org>
Taking a brief look before lunch,
> if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) {
> const u8 *ht_oper_ie, *ht_cap_ie;
>
>
>
>
> - ht_oper_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_OPERATION);
> + ht_oper_ie = elems->ht_operation ?
> + ((const u8 *)elems->ht_operation) - 2 :
> + NULL;
> if (ht_oper_ie && ht_oper_ie[1] >= sizeof(*ht_oper))
> ht_oper = (void *)(ht_oper_ie + 2);
Can't we drop these checks, and simply do
ht_oper = elems->ht_operation?
After all, ieee802_11_parse_elems() should already be doing the
necessary length checks? We just didn't have that with
ieee80211_bss_get_ie().
> - ht_cap_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_CAPABILITY);
> + ht_cap_ie = elems->ht_cap_elem ?
> + ((const u8 *)elems->ht_cap_elem) - 2 :
> + NULL;
> if (ht_cap_ie && ht_cap_ie[1] >= sizeof(*ht_cap))
> ht_cap = (void *)(ht_cap_ie + 2);
Likewise for all the others.
johannes
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2021-09-24 10:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 10:00 [PATCH v4 0/6] cfg80211/mac80211: Add support for 6GHZ STA for various modes : LPI, SP and VLP Wen Gong
2021-09-24 10:00 ` [PATCH v4 1/6] mac80211: add power type definition for 6 GHz Wen Gong
2021-09-24 10:00 ` [PATCH v4 2/6] mac80211: add parse regulatory info in 6 GHz operation information Wen Gong
2021-09-27 11:22 ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 3/6] cfg80211: add definition for 6 GHz power spectral density(psd) Wen Gong
2021-09-27 11:28 ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 4/6] cfg80211: save power spectral density(psd) of regulatory rule Wen Gong
2021-09-27 11:27 ` Johannes Berg
2021-09-28 9:05 ` Wen Gong
2021-09-24 10:00 ` [PATCH v4 5/6] mac80211: use ieee802_11_parse_elems() to find ies instead of ieee80211_bss_get_ie() Wen Gong
2021-09-24 10:13 ` Johannes Berg [this message]
2021-09-24 10:47 ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 6/6] mac80211: save transmit power envelope element and power constraint Wen Gong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b02735cc844c9ba2222d23a7e6ad112a82a36891.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=wgong@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).