developer | dad89a3 | 2024-04-29 14:17:17 +0800 | [diff] [blame] | 1 | From 95dcf88b68837221ad937fe7c675b169c8034384 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 22 Apr 2024 08:40:18 +0800 |
| 4 | Subject: [PATCH] mtk: hostapd: free station when hapd deinit |
| 5 | |
| 6 | Free all stations in the same MLD when a bss is deinit. |
| 7 | Without this patch, the AP_VLAN interface may be free after |
| 8 | stop ap and leads to kernel crash. |
| 9 | |
| 10 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 11 | --- |
| 12 | src/ap/hostapd.c | 14 ++++++++++++++ |
| 13 | 1 file changed, 14 insertions(+) |
| 14 | |
| 15 | diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c |
| 16 | index 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 | -- |
| 42 | 2.18.0 |
| 43 | |