aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-01-28 21:36:44 +0100
committerFelix Fietkau <nbd@nbd.name>2019-01-29 11:27:13 +0100
commit4443804b545f19b12571cb8b532fa55926e3e3f3 (patch)
tree802dc8f0ec565d93c4de234b0a0fceede6289de4 /package
parentae6b5815cd01864ad10e7d26b3565b2af3aa938c (diff)
downloadupstream-4443804b545f19b12571cb8b532fa55926e3e3f3.tar.gz
upstream-4443804b545f19b12571cb8b532fa55926e3e3f3.tar.bz2
upstream-4443804b545f19b12571cb8b532fa55926e3e3f3.zip
wpa_supplicant: fix calling channel switch via wpa_cli on mesh interfaces
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r--package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch
new file mode 100644
index 0000000000..b9a0b23a7b
--- /dev/null
+++ b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch
@@ -0,0 +1,39 @@
+--- a/wpa_supplicant/ap.c
++++ b/wpa_supplicant/ap.c
+@@ -1363,15 +1363,35 @@ int ap_switch_channel(struct wpa_supplic
+
+
+ #ifdef CONFIG_CTRL_IFACE
++
++static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface,
++ struct csa_settings *settings)
++{
++#ifdef NEED_AP_MLME
++ if (!iface || !iface->bss[0])
++ return 0;
++
++ return hostapd_switch_channel(iface->bss[0], settings);
++#else
++ return -1;
++#endif
++}
++
++
+ int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos)
+ {
+ struct csa_settings settings;
+ int ret = hostapd_parse_csa_settings(pos, &settings);
+
++ if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
++ !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
++ return -1;
++
++ ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
+ if (ret)
+ return ret;
+
+- return ap_switch_channel(wpa_s, &settings);
++ return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
+ }
+ #endif /* CONFIG_CTRL_IFACE */
+