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 <marek.puzyniak@tieto.com>
This commit is contained in:
Marek Puzyniak 2014-04-16 12:22:14 +02:00 committed by Jouni Malinen
parent d41cc8ccf6
commit 8a0f3bf613

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