#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
#include "radius/radius_client.h"
+#include "drivers/driver.h"
#include "hostapd.h"
#include "authsrv.h"
#include "sta_info.h"
#include "wpa_auth.h"
#include "wps_hostapd.h"
#include "hw_features.h"
-#include "driver_i.h"
#include "wpa_auth_glue.h"
#include "ap_drv_ops.h"
+#include "ap_config.h"
static int hostapd_flush_old_stations(struct hostapd_data *hapd);
if (hapd->conf->wpa && hapd->wpa_auth == NULL)
hostapd_setup_wpa(hapd);
- else if (hapd->conf->wpa)
+ else if (hapd->conf->wpa) {
+ const u8 *wpa_ie;
+ size_t wpa_ie_len;
hostapd_reconfig_wpa(hapd);
- else if (hapd->wpa_auth) {
+ wpa_ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &wpa_ie_len);
+ if (hostapd_set_generic_elem(hapd, wpa_ie, wpa_ie_len))
+ wpa_printf(MSG_ERROR, "Failed to configure WPA IE for "
+ "the kernel driver.");
+ } else if (hapd->wpa_auth) {
wpa_deinit(hapd->wpa_auth);
hapd->wpa_auth = NULL;
hostapd_set_privacy(hapd, 0);
hostapd_setup_encryption(hapd->conf->iface, hapd);
+ hostapd_set_generic_elem(hapd, (u8 *) "", 0);
}
ieee802_11_set_beacon(hapd);
{
int ret = 0;
- if (hostapd_drv_none(hapd))
+ if (hostapd_drv_none(hapd) || hapd->drv_priv == NULL)
return 0;
wpa_printf(MSG_DEBUG, "Flushing old station entries");
struct hostapd_bss_config *conf = hapd->conf;
u8 ssid[HOSTAPD_MAX_SSID_LEN + 1];
int ssid_len, set_ssid;
+ char force_ifname[IFNAMSIZ];
+ u8 if_addr[ETH_ALEN];
if (!first) {
if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) {
hapd->interface_added = 1;
if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS,
- hapd->conf->iface, hapd->own_addr, hapd)) {
+ hapd->conf->iface, hapd->own_addr, hapd,
+ &hapd->drv_priv, force_ifname, if_addr)) {
wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID="
MACSTR ")", MAC2STR(hapd->own_addr));
return -1;
if (hostapd_init_wps(hapd, conf))
return -1;
+ if (authsrv_init(hapd) < 0)
+ return -1;
+
if (ieee802_1x_init(hapd)) {
wpa_printf(MSG_ERROR, "IEEE 802.1X initialization failed.");
return -1;
ieee802_11_set_beacon(hapd);
- if (authsrv_init(hapd) < 0)
- return -1;
-
return 0;
}
hostapd_flush_old_stations(hapd);
hostapd_cleanup(hapd);
}
+}
+
+
+void hostapd_interface_free(struct hostapd_iface *iface)
+{
+ size_t j;
for (j = 0; j < iface->num_bss; j++)
os_free(iface->bss[j]);
hostapd_cleanup_iface(iface);