aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-01-30 10:43:19 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-08 10:27:23 (GMT)
commitb5bd5cdc2b311c9dbf7b34e4ebc39191861a3f35 (patch)
tree65a1a06670b71701368e05baa7b1fabbfb4bb7a3
parente822c28d465a1a68577874f74973fe1a916352c6 (diff)
downloadhostap-06-b5bd5cdc2b311c9dbf7b34e4ebc39191861a3f35.zip
hostap-06-b5bd5cdc2b311c9dbf7b34e4ebc39191861a3f35.tar.gz
hostap-06-b5bd5cdc2b311c9dbf7b34e4ebc39191861a3f35.tar.bz2
Do not use country_code default (was: US)
If country_code is not included in hostapd.conf, refuse to enable IEEE 802.11d and do not try to set the regulatory domain in kernel. (cherry picked from commit 6f4071c084be304e7f16a939eb3127de98a1ff0a)
-rw-r--r--hostapd/config.c8
-rw-r--r--hostapd/hostapd.c12
-rw-r--r--hostapd/hostapd.conf5
3 files changed, 15 insertions, 10 deletions
diff --git a/hostapd/config.c b/hostapd/config.c
index 455e94e..6ad14d2 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -248,8 +248,6 @@ static struct hostapd_config * hostapd_config_defaults(void)
conf->send_probe_response = 1;
conf->bridge_packets = INTERNAL_BRIDGE_DO_NOT_CONTROL;
- os_memcpy(conf->country, "US ", 3);
-
for (i = 0; i < NUM_TX_QUEUES; i++)
conf->tx_queue[i].aifs = -1; /* use hw default */
@@ -966,6 +964,12 @@ static int hostapd_config_check(struct hostapd_config *conf)
{
size_t i;
+ if (conf->ieee80211d && (!conf->country[0] || !conf->country[1])) {
+ wpa_printf(MSG_ERROR, "Cannot enable IEEE 802.11d without "
+ "setting the country_code");
+ return -1;
+ }
+
for (i = 0; i < conf->num_bss; i++) {
if (hostapd_config_check_bss(&conf->bss[i], conf))
return -1;
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index afff924..df6062b 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -1543,11 +1543,13 @@ static int setup_interface(struct hostapd_iface *iface)
OP_MODE_PURE);
#endif /* CONFIG_IEEE80211N */
- os_memcpy(country, hapd->iconf->country, 3);
- country[3] = '\0';
- if (hostapd_set_country(hapd, country) < 0) {
- wpa_printf(MSG_ERROR, "Failed to set country code");
- return -1;
+ if (hapd->iconf->country[0] && hapd->iconf->country[1]) {
+ os_memcpy(country, hapd->iconf->country, 3);
+ country[3] = '\0';
+ if (hostapd_set_country(hapd, country) < 0) {
+ wpa_printf(MSG_ERROR, "Failed to set country code");
+ return -1;
+ }
}
if (hapd->iconf->ieee80211d &&
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index a4a033a..0602cb0 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -77,10 +77,9 @@ ctrl_interface_group=0
# SSID to be used in IEEE 802.11 management frames
ssid=test
-# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
-# Modify as needed to indicate country in which device is operating.
+# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
+# Set as needed to indicate country in which device is operating.
# This can limit available channels and transmit power.
-# (default: US)
#country_code=US
# Enable IEEE 802.11d. This advertises the country_code and the set of allowed