]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Fix checking if DFS is required
authorMarek Puzyniak <marek.puzyniak@tieto.com>
Wed, 16 Apr 2014 10:22:14 +0000 (12:22 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 17 Apr 2014 14:12:52 +0000 (17:12 +0300)
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 <marek.puzyniak@tieto.com>
src/ap/dfs.c

index 3fb18810cf43ff45adab6588ec35eaae7ae40abe..c30f6d6ad4ec340e6bb6e47db44e049072c73b16 100644 (file)
@@ -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);