1 --- a/wpa_supplicant/ap.c
2 +++ b/wpa_supplicant/ap.c
3 @@ -1373,15 +1373,35 @@ int ap_switch_channel(struct wpa_supplic
6 #ifdef CONFIG_CTRL_IFACE
8 +static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface,
9 + struct csa_settings *settings)
12 + if (!iface || !iface->bss[0])
15 + return hostapd_switch_channel(iface->bss[0], settings);
22 int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos)
24 struct csa_settings settings;
25 int ret = hostapd_parse_csa_settings(pos, &settings);
27 + if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
28 + !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
31 + ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
35 - return ap_switch_channel(wpa_s, &settings);
36 + return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
38 #endif /* CONFIG_CTRL_IFACE */