aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/hostapd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ap/hostapd.c')
-rw-r--r--src/ap/hostapd.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 303786b4..55ca9e8f 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -512,6 +512,9 @@ static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface)
if (hostapd_drv_none(hapd))
return 0;
+ if (iface->conf->use_driver_iface_addr)
+ return 0;
+
/* Generate BSSID mask that is large enough to cover the BSSIDs. */
/* Determine the bits necessary to cover the number of BSSIDs. */
@@ -905,12 +908,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
hapd->started = 1;
if (!first || first == -1) {
- if (is_zero_ether_addr(conf->bssid)) {
- /* Allocate the next available BSSID. */
- do {
- inc_byte_array(hapd->own_addr, ETH_ALEN);
- } while (mac_in_conf(hapd->iconf, hapd->own_addr));
- } else {
+ u8 *addr = hapd->own_addr;
+
+ if (!is_zero_ether_addr(conf->bssid)) {
/* Allocate the configured BSSID. */
os_memcpy(hapd->own_addr, conf->bssid, ETH_ALEN);
@@ -922,11 +922,18 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
"the radio", conf->iface);
return -1;
}
+ } else if (hapd->iconf->use_driver_iface_addr) {
+ addr = NULL;
+ } else {
+ /* Allocate the next available BSSID. */
+ do {
+ inc_byte_array(hapd->own_addr, ETH_ALEN);
+ } while (mac_in_conf(hapd->iconf, hapd->own_addr));
}
hapd->interface_added = 1;
if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
- conf->iface, hapd->own_addr, hapd,
+ conf->iface, addr, hapd,
&hapd->drv_priv, force_ifname, if_addr,
conf->bridge[0] ? conf->bridge : NULL,
first == -1)) {
@@ -935,6 +942,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
hapd->interface_added = 0;
return -1;
}
+
+ if (!addr)
+ os_memcpy(hapd->own_addr, if_addr, ETH_ALEN);
}
if (conf->wmm_enabled < 0)
@@ -1859,6 +1869,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
hapd->iface = hapd_iface;
hapd->driver = hapd->iconf->driver;
hapd->ctrl_sock = -1;
+ dl_list_init(&hapd->ctrl_dst);
return hapd;
}