[PATCH] mesh: allow channel switch command

Markus Theil markus.theil at tu-ilmenau.de
Fri Jun 26 10:20:43 EDT 2020


Signed-off-by: Markus Theil <markus.theil at tu-ilmenau.de>
---
 wpa_supplicant/ap.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index b6b1aaae8..a25110d4d 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1460,10 +1460,18 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s,
 		      struct csa_settings *settings)
 {
 #ifdef NEED_AP_MLME
-	if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
+	struct hostapd_iface *iface = NULL;
+
+	if (wpa_s->ap_iface)
+		iface = wpa_s->ap_iface;
+
+	if (wpa_s->ifmsh)
+		iface = wpa_s->ifmsh;
+
+	if (!iface || !iface->bss[0])
 		return -1;
 
-	return hostapd_switch_channel(wpa_s->ap_iface->bss[0], settings);
+	return hostapd_switch_channel(iface->bss[0], settings);
 #else /* NEED_AP_MLME */
 	return -1;
 #endif /* NEED_AP_MLME */
-- 
2.27.0




More information about the Hostap mailing list