]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Allow channel switch command
authorMarkus Theil <markus.theil@tu-ilmenau.de>
Fri, 26 Jun 2020 14:20:43 +0000 (16:20 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2020 08:24:14 +0000 (11:24 +0300)
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
wpa_supplicant/ap.c

index 2accf92cd4134181e2ce85cc2f1e3c907e532d16..de3027dd70fe8e5f0bb88379617fbf4ddf6fce07 100644 (file)
@@ -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 */