From ae0b90dfa4f2db5992269a9335df1fc156e55b24 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Fri, 26 Jun 2020 16:20:43 +0200 Subject: [PATCH] mesh: Allow channel switch command Signed-off-by: Markus Theil --- wpa_supplicant/ap.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 2accf92cd..de3027dd7 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -1418,10 +1418,17 @@ 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; + else 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 */