blob: ade85505dcaa684910a6138f5d4d0a2f0f051f39 [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From dce3106e1c43076ab410af89f817e15cee7959a3 Mon Sep 17 00:00:00 2001
2From: Howard Hsu <howard-yh.hsu@mediatek.com>
3Date: Thu, 22 Sep 2022 16:08:09 +0800
4Subject: [PATCH 037/104] mtk: hostapd: Do not include HE capab IE if
5 associated sta's HE capab IE is invalid
6
7The parameter 'sta' passed to send_assoc_resp() might be NULL, so an
8NULL check is necessary before access the 'sta'.
9Only one such check was missed in this function, and this patch fixs it.
10
11CR-Id: WCNCR00289305
12Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
13Change-Id: I028b7779acfbce5292a60c9f800a83c57c999943
14---
15 src/ap/ieee802_11.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
19index bda61b998..d972a25f1 100644
20--- a/src/ap/ieee802_11.c
21+++ b/src/ap/ieee802_11.c
22@@ -4931,7 +4931,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
23 #endif /* CONFIG_IEEE80211AC */
24
25 #ifdef CONFIG_IEEE80211AX
26- if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax) {
27+ if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax && sta &&
28+ sta->flags & WLAN_STA_HE) {
29 p = hostapd_eid_he_capab(hapd, p, IEEE80211_MODE_AP);
30 p = hostapd_eid_he_operation(hapd, p);
31 p = hostapd_eid_cca(hapd, p);
32--
332.39.2
34