gluon/patches/openwrt/0015-hostapd-enter-DFS-state-if-no-available-channel-is-found.patch
David Bauer a3a55d6461
openwrt: backport DFS fixes (#2077)
This backports two fixes related to operation on DFS-required
channels.

When a DFS-required channel was selected as the regular
(non-outdoor-mode) 5 GHz channel, hostapd would switch to a non-DFS
channel as OpenWrt did not pass a chanlist of allowed ACS channels.

When hostapd is given a single channel for the chanlist or there's no
available channel left (all allowed channels are in the no-occupancy
period), hostapd prints "no DFS channels left, waiting for NOP to
finish" to the syslog but never stopped transmitting on this channel,
still sending out beacon frames and allowing client data transfer.
2020-07-29 15:45:17 +02:00

48 lines
1.9 KiB
Diff

From: David Bauer <mail@david-bauer.net>
Date: Sat, 4 Jul 2020 13:20:07 +0200
Subject: hostapd: enter DFS state if no available channel is found
Previously hostapd would not stop transmitting when a DFS event was
detected and no available channel to switch to was available.
Disable and re-enable the interface to enter DFS state. This way, TX
does not happen until the kernel notifies hostapd about the NOP
expiring.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch b/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch
new file mode 100644
index 0000000000000000000000000000000000000000..59e903f06ae66208517c2d620b4cd128f41f25c1
--- /dev/null
+++ b/package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch
@@ -0,0 +1,28 @@
+From cefc52e6b93731c713f1bba1cb5e7e92105b758b Mon Sep 17 00:00:00 2001
+From: David Bauer <mail@david-bauer.net>
+Date: Fri, 3 Jul 2020 23:00:34 +0200
+Subject: [PATCH] dfs: enter DFS state if no available channel is found
+
+Previously hostapd would not stop transmitting when a DFS event was
+detected and no available channel to switch to was available.
+
+Disable and re-enable the interface to enter DFS state. This way, TX
+does not happen until the kernel notifies hostapd about the NOP
+expiring.
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+---
+ src/ap/dfs.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -930,6 +930,8 @@ static int hostapd_dfs_start_channel_swi
+ wpa_printf(MSG_INFO,
+ "%s: no DFS channels left, waiting for NOP to finish",
+ __func__);
++ hostapd_disable_iface(iface);
++ hostapd_enable_iface(iface);
+ return err;
+ }
+