blob: 81b201593c484818a23324e2a5a4b1803ad8ac01 [file] [log] [blame]
developerdad89a32024-04-29 14:17:17 +08001From 95dcf88b68837221ad937fe7c675b169c8034384 Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 22 Apr 2024 08:40:18 +0800
4Subject: [PATCH] mtk: hostapd: free station when hapd deinit
5
6Free all stations in the same MLD when a bss is deinit.
7Without this patch, the AP_VLAN interface may be free after
8stop ap and leads to kernel crash.
9
10Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
11---
12 src/ap/hostapd.c | 14 ++++++++++++++
13 1 file changed, 14 insertions(+)
14
15diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
16index c31e0badd..62943c561 100644
17--- a/src/ap/hostapd.c
18+++ b/src/ap/hostapd.c
19@@ -842,7 +842,21 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
20
21 void hostapd_bss_deinit_no_free(struct hostapd_data *hapd)
22 {
23+#ifdef CONFIG_IEEE80211BE
24+ struct hostapd_data *link;
25+
26+ /* FIXME: free all stations to remvoe AP_VLAN interface. Allocate */
27+ /* per-link structures for AP_VLAN in mac80211 and only remove single */
28+ /* link here. */
29+ if (hostapd_is_mld_ap(hapd)) {
30+ for_each_mld_link(link, hapd)
31+ hostapd_free_stas(link);
32+ } else {
33+ hostapd_free_stas(hapd);
34+ }
35+#else
36 hostapd_free_stas(hapd);
37+#endif
38 hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
39 #ifdef CONFIG_WEP
40 hostapd_clear_wep(hapd);
41--
422.18.0
43