From 8a0f3bf6135d9e5d5e50de46c4755de0864f6c66 Mon Sep 17 00:00:00 2001 From: Marek Puzyniak Date: Wed, 16 Apr 2014 12:22:14 +0200 Subject: [PATCH] AP: Fix checking if DFS is required Sometimes function hostapd_is_dfs_required() returns -1 which indicates that it was not possible to check if DFS was required. This happens for channels from the 2.4 GHz band where DFS checking should not happen. This can be fixed by returning DFS-not-required for mode different from IEEE80211A and when DFS support is not available (ieee80211h not set). Signed-off-by: Marek Puzyniak --- src/ap/dfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 3fb18810c..c30f6d6ad 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -916,8 +916,9 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface) { int n_chans, start_chan_idx; - if (!iface->current_mode) - return -1; + if (!iface->conf->ieee80211h || !iface->current_mode || + iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A) + return 0; /* Get start (first) channel for current configuration */ start_chan_idx = dfs_get_start_chan_idx(iface);