DFS: Fix hostapd operation without hw_mode driver data

If DFS implementation was built in, some configurations with drivers
that do not provide mode information could end up dereferencing a NULL
pointer. Fix this by skipping DFS operations in such cases since not
having information about modes and channels means that hostapd could not
perform DFS anyway (i.e., either this is not a wireless driver or the
driver takes care of DFS internally).

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-11-17 01:14:35 +02:00
parent e9b783d58c
commit afbe57d981

View File

@ -640,6 +640,16 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
int res, n_chans, n_chans1, start_chan_idx, start_chan_idx1; int res, n_chans, n_chans1, start_chan_idx, start_chan_idx1;
int skip_radar = 0; int skip_radar = 0;
if (!iface->current_mode) {
/*
* This can happen with drivers that do not provide mode
* information and as such, cannot really use hostapd for DFS.
*/
wpa_printf(MSG_DEBUG,
"DFS: No current_mode information - assume no need to perform DFS operations by hostapd");
return 1;
}
iface->cac_started = 0; iface->cac_started = 0;
do { do {