* nothing works correctly, so let's skip sending this for the hostap
* driver. */
- if (os_strcmp(hapd->driver->name, "hostap") != 0) {
+ if (hapd->driver && os_strcmp(hapd->driver->name, "hostap") != 0) {
os_memset(addr, 0xff, ETH_ALEN);
hostapd_sta_deauth(hapd, addr,
WLAN_REASON_PREV_AUTH_NOT_VALID);
wconf->eapol_version = conf->eapol_version;
wconf->peerkey = conf->peerkey;
wconf->wme_enabled = conf->wme_enabled;
+ wconf->okc = conf->okc;
#ifdef CONFIG_IEEE80211W
wconf->ieee80211w = conf->ieee80211w;
#endif /* CONFIG_IEEE80211W */
{
int ret = 0;
+ if (hostapd_drv_none(hapd))
+ return 0;
+
wpa_printf(MSG_DEBUG, "Flushing old station entries");
if (hostapd_flush(hapd)) {
printf("Could not connect to kernel driver.\n");
}
+static int hostapd_wpa_auth_for_each_auth(
+ void *ctx, int (*cb)(struct wpa_authenticator *sm, void *ctx),
+ void *cb_ctx)
+{
+ struct hostapd_data *ohapd;
+ size_t i, j;
+ struct hapd_interfaces *interfaces = eloop_get_user_data();
+
+ for (i = 0; i < interfaces->count; i++) {
+ for (j = 0; j < interfaces->iface[i]->num_bss; j++) {
+ ohapd = interfaces->iface[i]->bss[j];
+ if (cb(ohapd->wpa_auth, cb_ctx))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
static int hostapd_wpa_auth_send_ether(void *ctx, const u8 *dst, u16 proto,
const u8 *data, size_t data_len)
{
unsigned int i = iface->conf->num_bss, bits = 0, j;
int res;
+ if (hostapd_drv_none(hapd))
+ return 0;
+
/* Generate BSSID mask that is large enough to cover the BSSIDs. */
/* Determine the bits necessary to cover the number of BSSIDs. */
cb.get_seqnum_igtk = hostapd_wpa_auth_get_seqnum_igtk;
cb.send_eapol = hostapd_wpa_auth_send_eapol;
cb.for_each_sta = hostapd_wpa_auth_for_each_sta;
+ cb.for_each_auth = hostapd_wpa_auth_for_each_auth;
cb.send_ether = hostapd_wpa_auth_send_ether;
#ifdef CONFIG_IEEE80211R
cb.send_ft_action = hostapd_wpa_auth_send_ft_action;
srv.ssl_ctx = hapd->ssl_ctx;
srv.pac_opaque_encr_key = conf->pac_opaque_encr_key;
srv.eap_fast_a_id = conf->eap_fast_a_id;
+ srv.eap_fast_a_id_len = conf->eap_fast_a_id_len;
+ srv.eap_fast_a_id_info = conf->eap_fast_a_id_info;
+ srv.eap_fast_prov = conf->eap_fast_prov;
+ srv.pac_key_lifetime = conf->pac_key_lifetime;
+ srv.pac_key_refresh_time = conf->pac_key_refresh_time;
srv.eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
srv.tnc = conf->tnc;
srv.ipv6 = conf->radius_server_ipv6;
conf->ssid.ssid[conf->ssid.ssid_len] = '\0';
}
- printf("Using interface %s with hwaddr " MACSTR " and ssid '%s'\n",
- hapd->conf->iface, MAC2STR(hapd->own_addr),
- hapd->conf->ssid.ssid);
+ if (!hostapd_drv_none(hapd)) {
+ printf("Using interface %s with hwaddr " MACSTR
+ " and ssid '%s'\n",
+ hapd->conf->iface, MAC2STR(hapd->own_addr),
+ hapd->conf->ssid.ssid);
+ }
if (hostapd_setup_wpa_psk(conf)) {
printf("WPA-PSK setup failed.\n");
return -1;
}
- if (vlan_init(hapd)) {
+ if (!hostapd_drv_none(hapd) && vlan_init(hapd)) {
printf("VLAN initialization failed.\n");
return -1;
}
#ifdef CONFIG_IEEE80211R
- hapd->l2 = l2_packet_init(hapd->conf->iface, NULL, ETH_P_RRB,
- hostapd_rrb_receive, hapd, 0);
- if (hapd->l2 == NULL &&
- (hapd->driver == NULL || hapd->driver->send_ether == NULL)) {
- printf("Failed to open l2_packet interface\n");
- return -1;
+ if (!hostapd_drv_none(hapd)) {
+ hapd->l2 = l2_packet_init(hapd->conf->iface, NULL, ETH_P_RRB,
+ hostapd_rrb_receive, hapd, 0);
+ if (hapd->l2 == NULL &&
+ (hapd->driver == NULL ||
+ hapd->driver->send_ether == NULL)) {
+ printf("Failed to open l2_packet interface\n");
+ return -1;
+ }
}
#endif /* CONFIG_IEEE80211R */
if (hostapd_validate_bssid_configuration(iface))
return -1;
+#ifdef CONFIG_IEEE80211N
+ SET_2BIT_LE16(&iface->ht_op_mode,
+ HT_INFO_OPERATION_MODE_OP_MODE_OFFSET,
+ 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_DEBUG, "%s: Unable to setup interface.",
iface->bss[0]->conf->iface);
eloop_terminate();
- } else
+ } else if (!hostapd_drv_none(iface->bss[0]))
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface);
}