Reject hostapd configuration without channel for nl80211 drivers
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 6 May 2009 13:07:43 +0000 (16:07 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 6 May 2009 13:07:43 +0000 (16:07 +0300)
We could use auto-channel selection here eventually, but for now,
reject the configuration since it is not going to work correctly
(Beacon and Probe Response frames use incorrect value  in DS Params).

hostapd/hw_features.c

index f5be71f..0516b1b 100644 (file)
@@ -627,6 +627,13 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
                        break;
                }
        }
+       if (iface->conf->channel == 0) {
+               /* TODO: could request a scan of neighboring BSSes and select
+                * the channel automatically */
+               wpa_printf(MSG_ERROR, "Channel not configured "
+                          "(hw_mode/channel in hostapd.conf)");
+               return -1;
+       }
        if (ok == 0 && iface->conf->channel != 0) {
                hostapd_logger(iface->bss[0], NULL,
                               HOSTAPD_MODULE_IEEE80211,