diff mbox

ap: Fix checking if DFS is required

Message ID 1397643734-25086-1-git-send-email-marek.puzyniak@tieto.com
State Accepted
Headers show

Commit Message

Marek Puzyniak April 16, 2014, 10:22 a.m. UTC
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@tieto.com>
---
 src/ap/dfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jouni Malinen April 17, 2014, 4:13 p.m. UTC | #1
On Wed, Apr 16, 2014 at 12:22:14PM +0200, Marek Puzyniak wrote:
> 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).

Thanks, applied.
diff mbox

Patch

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);