openwrt/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch
Eneas U de Queiroz 92379080ea hostapd: adjust patches to work with git am
This adds From:, Date: and Subject: to patches, allowing one to run 'git
am' to import the patches to a hostapd git repository.

From: and Date: fields were taken from the OpenWrt commit where the
patches were first introduced.

Most of the Subject: also followed suit, except for:
 - 300-noscan.patch: Took the description from the LuCI web interface
 - 350-nl80211_del_beacon_bss.patch: Used the file name

The order of the files in the patch was changed to match what git
format-patch does.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2024-04-04 12:12:43 +02:00

49 lines
1.1 KiB
Diff

From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 28 Jan 2019 21:36:44 +0100
Subject: [PATCH] wpa_supplicant: fix calling channel switch via wpa_cli on
mesh interfaces
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1846,17 +1846,37 @@ 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 (ret)
- return ret;
+ if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
+ !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
+ return -1;
settings.link_id = -1;
- return ap_switch_channel(wpa_s, &settings);
+ ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
+ if (ret)
+ return ret;
+
+ return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
}
#endif /* CONFIG_CTRL_IFACE */