]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Reset channel switch parameters on interface disable
authorSriram R <srirrama@codeaurora.org>
Fri, 14 Sep 2018 11:06:06 +0000 (16:36 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 19 Oct 2018 18:26:03 +0000 (21:26 +0300)
Previously, when an AP interface was disabled through a control
interface DISABLE command during a channel switch window, the interface
could not be reenabled due to beacon setup failure (which validates if
CSA is in progress).

Fix this by clearing channel switch parameters while disabling the
hostapd interface.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
src/ap/hostapd.c

index 23d27207508d048db035f2c718d79fcb7711a2a1..117ee08363a876be8f891e18e8ea1871defbd1a4 100644 (file)
@@ -2620,6 +2620,11 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
                !!(hapd_iface->drv_flags &
                   WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT);
 
+#ifdef NEED_AP_MLME
+       for (j = 0; j < hapd_iface->num_bss; j++)
+               hostapd_cleanup_cs_params(hapd_iface->bss[j]);
+#endif /* NEED_AP_MLME */
+
        /* same as hostapd_interface_deinit without deinitializing ctrl-iface */
        for (j = 0; j < hapd_iface->num_bss; j++) {
                struct hostapd_data *hapd = hapd_iface->bss[j];
@@ -3428,7 +3433,6 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
                                const struct hostapd_freq_params *freq_params)
 {
        int vht_seg0_idx = 0, vht_seg1_idx = 0, vht_bw = VHT_CHANWIDTH_USE_HT;
-       unsigned int i;
 
        wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes");
 
@@ -3470,10 +3474,8 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
        /*
         * cs_params must not be cleared earlier because the freq_params
         * argument may actually point to one of these.
+        * These params will be cleared during interface disable below.
         */
-       for (i = 0; i < iface->num_bss; i++)
-               hostapd_cleanup_cs_params(iface->bss[i]);
-
        hostapd_disable_iface(iface);
        hostapd_enable_iface(iface);
 }