DFS: Do not process radar event while disabling an interface
In the normal case hostapd_disable_iface() and hostapd_enable_iface() will be done while switching to another DFS channel upon radar detection. In certain scenarios radar detected event can come while hostapd_disable_iface() is in progress and iface->current_mode will be NULL in that scenario. Previously, we did not check for this scenario and proceeded with the radar detection logic which can trigger a segmentation fault. To fix this, avoid proceeding the radar detection event if iface->current_mode is NULL. Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
This commit is contained in:
parent
744a2f9846
commit
7242087d1c
1 changed files with 4 additions and 2 deletions
|
@ -1040,8 +1040,10 @@ int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* mark radar frequency as invalid */
|
/* mark radar frequency as invalid */
|
||||||
set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
|
res = set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
|
||||||
cf1, cf2, HOSTAPD_CHAN_DFS_UNAVAILABLE);
|
cf1, cf2, HOSTAPD_CHAN_DFS_UNAVAILABLE);
|
||||||
|
if (!res)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Skip if reported radar event not overlapped our channels */
|
/* Skip if reported radar event not overlapped our channels */
|
||||||
res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2);
|
res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2);
|
||||||
|
|
Loading…
Reference in a new issue