diff mbox series

[v2] robust_av: use wpa_bss_ext_capab() helper

Message ID 1611083256-I3a247a9b30b9de89e994dadf9c1d76c524830df5@changeid
State Accepted
Headers show
Series [v2] robust_av: use wpa_bss_ext_capab() helper | expand

Commit Message

Johannes Berg Jan. 19, 2021, 7:07 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Use the helper instead of open-coding the check. Since the
helper doesn't handle a NULL BSS, keep that extra check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 wpa_supplicant/robust_av.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Jouni Malinen Feb. 6, 2021, 10:12 a.m. UTC | #1
On Tue, Jan 19, 2021 at 08:07:36PM +0100, Johannes Berg wrote:
> Use the helper instead of open-coding the check. Since the
> helper doesn't handle a NULL BSS, keep that extra check.

Thanks, applied.
diff mbox series

Patch

diff --git a/wpa_supplicant/robust_av.c b/wpa_supplicant/robust_av.c
index 1280f5d96e7e..7ecd35769cc5 100644
--- a/wpa_supplicant/robust_av.c
+++ b/wpa_supplicant/robust_av.c
@@ -48,18 +48,14 @@  void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
 int wpas_send_mscs_req(struct wpa_supplicant *wpa_s)
 {
 	struct wpabuf *buf;
-	const u8 *ext_capab = NULL;
 	size_t buf_len;
 	int ret;
 
 	if (wpa_s->wpa_state != WPA_COMPLETED || !wpa_s->current_ssid)
 		return 0;
 
-	if (wpa_s->current_bss)
-		ext_capab = wpa_bss_get_ie(wpa_s->current_bss,
-					   WLAN_EID_EXT_CAPAB);
-
-	if (!ext_capab || ext_capab[1] < 11 || !(ext_capab[12] & 0x20)) {
+	if (!wpa_s->current_bss ||
+	    !wpa_bss_ext_capab(wpa_s->current_bss, WLAN_EXT_CAPAB_MSCS)) {
 		wpa_dbg(wpa_s, MSG_INFO,
 			"AP does not support MSCS - could not send MSCS Req");
 		return -1;