Updated to hostap_2_6
[mech_eap.git] / libeap / src / ap / acs.c
index 03d797f..5e83805 100644 (file)
@@ -599,8 +599,7 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
        wpa_printf(MSG_DEBUG, "ACS: Survey analysis for selected bandwidth %d MHz",
                   n_chans == 1 ? 20 :
                   n_chans == 2 ? 40 :
-                  n_chans == 4 ? 80 :
-                  -1);
+                  80);
 
        for (i = 0; i < iface->current_mode->num_channels; i++) {
                double total_weight;
@@ -933,6 +932,9 @@ enum hostapd_chan_status acs_init(struct hostapd_iface *iface)
                return HOSTAPD_CHAN_ACS;
        }
 
+       if (!iface->current_mode)
+               return HOSTAPD_CHAN_INVALID;
+
        acs_cleanup(iface);
 
        err = acs_request_scan(iface);