]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Enter DFS state if no available channel is found
authorDavid Bauer <mail@david-bauer.net>
Sat, 4 Jul 2020 08:12:21 +0000 (10:12 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Dec 2020 14:49:29 +0000 (16:49 +0200)
Previously hostapd would not stop transmitting when a DFS event was
detected and no available channel to switch to was available.

Disable and re-enable the interface to enter DFS state. This way, TX
does not happen until the kernel notifies hostapd about the NOP
expiring.

Signed-off-by: David Bauer <mail@david-bauer.net>
src/ap/dfs.c

index 15ef50bce860bb20c37bb2b04619aa14f1e8acad..84db7f28d85040f56789688f6321c508f393f35c 100644 (file)
@@ -1070,8 +1070,16 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
                                                  &oper_centr_freq_seg0_idx,
                                                  &oper_centr_freq_seg1_idx,
                                                  &skip_radar);
-               if (!channel)
-                       return err;
+               if (!channel) {
+                       /*
+                        * Toggle interface state to enter DFS state
+                        * until NOP is finished.
+                        */
+                       hostapd_disable_iface(iface);
+                       hostapd_enable_iface(iface);
+                       return 0;
+               }
+
                if (!skip_radar) {
                        iface->freq = channel->freq;
                        iface->conf->channel = channel->chan;