aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-08-24 18:27:51 +0200
committerFelix Fietkau <nbd@nbd.name>2023-08-24 18:29:36 +0200
commit22ca6fdeeb8fda642a8d50fc93b95781392ea97e (patch)
tree83c1d0d2d7c51499fbbd1285d7c024028489c604 /package
parent12f53724c6575245cf8b2f0dc75d1b9b2e4fe488 (diff)
downloadupstream-22ca6fdeeb8fda642a8d50fc93b95781392ea97e.tar.gz
upstream-22ca6fdeeb8fda642a8d50fc93b95781392ea97e.tar.bz2
upstream-22ca6fdeeb8fda642a8d50fc93b95781392ea97e.zip
hostapd: fix bringing up AP+STA when the new channel is on a DFS channel
If a CAC is needed because the channel is not available yet, a full AP interface restart is needed Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r--package/network/services/hostapd/src/src/ap/ucode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c
index 053171b1429..080fe48b11a 100644
--- a/package/network/services/hostapd/src/src/ap/ucode.c
+++ b/package/network/services/hostapd/src/src/ap/ucode.c
@@ -7,6 +7,7 @@
#include "beacon.h"
#include "hw_features.h"
#include "ap_drv_ops.h"
+#include "dfs.h"
#include <libubox/uloop.h>
static uc_resource_type_t *global_type, *bss_type, *iface_type;
@@ -367,6 +368,13 @@ out:
if (conf->channel)
iface->freq = hostapd_hw_get_freq(iface->bss[0], conf->channel);
+ if (hostapd_is_dfs_required(iface) && !hostapd_is_dfs_chan_available(iface)) {
+ wpa_printf(MSG_INFO, "DFS CAC required on new channel, restart interface");
+ hostapd_disable_iface(iface);
+ hostapd_enable_iface(iface);
+ return ucv_boolean_new(true);
+ }
+
for (i = 0; i < iface->num_bss; i++) {
struct hostapd_data *hapd = iface->bss[i];
int ret;