]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Do not process radar event while disabling an interface
authorSeevalamuthu Mariappan <seevalam@codeaurora.org>
Fri, 13 Dec 2019 10:16:41 +0000 (15:46 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 3 Mar 2020 15:10:31 +0000 (17:10 +0200)
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>
src/ap/dfs.c

index f70ecc9463287050fcc71d4ac1f73065b864c158..554231e189f15e240e21a07c43aebf2bb0872d1b 100644 (file)
@@ -1040,8 +1040,10 @@ int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq,
                return 0;
 
        /* mark radar frequency as invalid */
-       set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
-                     cf1, cf2, HOSTAPD_CHAN_DFS_UNAVAILABLE);
+       res = set_dfs_state(iface, freq, ht_enabled, chan_offset, chan_width,
+                           cf1, cf2, HOSTAPD_CHAN_DFS_UNAVAILABLE);
+       if (!res)
+               return 0;
 
        /* Skip if reported radar event not overlapped our channels */
        res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2);