[PATCH] ap: Fix checking if DFS is required

Marek Puzyniak marek.puzyniak
Wed Apr 16 03:22:14 PDT 2014


Sometimes function hostapd_is_dfs_required returns -1 what indicates
that it was not possible to check if dfs was required. It happens
for channels from 2,4 GHz band where DFS checking should not happen.
This can be fixed by returning DFS not required for mode different than
IEEE80211A and when DFS support is not available (ieee80211h not set).

Signed-off-by: Marek Puzyniak <marek.puzyniak at tieto.com>
---
 src/ap/dfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 3fb1881..abec652 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -916,8 +916,11 @@ 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)
+		return 0;
+
+	if (!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);
-- 
1.8.1.2




More information about the Hostap mailing list