aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostapd/hostapd.c')
-rw-r--r--hostapd/hostapd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index 6ab8658..1fd1f60 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -1240,6 +1240,7 @@ static int setup_interface1(struct hostapd_iface *iface)
struct hostapd_data *hapd = iface->bss[0];
struct hostapd_bss_config *conf = hapd->conf;
size_t i;
+ char country[4];
/*
* Initialize the driver interface and make sure that all BSSes get
@@ -1257,6 +1258,21 @@ static int setup_interface1(struct hostapd_iface *iface)
if (hostapd_validate_bssid_configuration(iface))
return -1;
+ memcpy(country, hapd->iconf->country, 3);
+ country[3] = '\0';
+ if (hostapd_set_country(hapd, country) < 0) {
+ printf("Failed to set country code\n");
+ return -1;
+ }
+
+ if (hapd->iconf->ieee80211d || hapd->iconf->ieee80211h) {
+ if (hostapd_set_ieee80211d(hapd, 1) < 0) {
+ printf("Failed to set ieee80211d (%d)\n",
+ hapd->iconf->ieee80211d);
+ return -1;
+ }
+ }
+
if (hapd->iconf->bridge_packets != INTERNAL_BRIDGE_DO_NOT_CONTROL &&
hostapd_set_internal_bridge(hapd, hapd->iconf->bridge_packets)) {
printf("Failed to set bridge_packets for kernel driver\n");