2 * hostapd / WPA authenticator glue code
3 * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 #include "utils/includes.h"
11 #include "utils/common.h"
12 #include "common/ieee802_11_defs.h"
13 #include "common/sae.h"
14 #include "common/wpa_ctrl.h"
15 #include "crypto/sha1.h"
16 #include "eapol_auth/eapol_auth_sm.h"
17 #include "eapol_auth/eapol_auth_sm_i.h"
18 #include "eap_server/eap.h"
19 #include "l2_packet/l2_packet.h"
21 #include "ieee802_1x.h"
22 #include "preauth_auth.h"
24 #include "tkip_countermeasures.h"
25 #include "ap_drv_ops.h"
26 #include "ap_config.h"
28 #include "wpa_auth_glue.h"
31 static void hostapd_wpa_auth_conf(struct hostapd_bss_config
*conf
,
32 struct hostapd_config
*iconf
,
33 struct wpa_auth_config
*wconf
)
35 os_memset(wconf
, 0, sizeof(*wconf
));
36 wconf
->wpa
= conf
->wpa
;
37 wconf
->wpa_key_mgmt
= conf
->wpa_key_mgmt
;
38 wconf
->wpa_pairwise
= conf
->wpa_pairwise
;
39 wconf
->wpa_group
= conf
->wpa_group
;
40 wconf
->wpa_group_rekey
= conf
->wpa_group_rekey
;
41 wconf
->wpa_strict_rekey
= conf
->wpa_strict_rekey
;
42 wconf
->wpa_gmk_rekey
= conf
->wpa_gmk_rekey
;
43 wconf
->wpa_ptk_rekey
= conf
->wpa_ptk_rekey
;
44 wconf
->rsn_pairwise
= conf
->rsn_pairwise
;
45 wconf
->rsn_preauth
= conf
->rsn_preauth
;
46 wconf
->eapol_version
= conf
->eapol_version
;
47 wconf
->peerkey
= conf
->peerkey
;
48 wconf
->wmm_enabled
= conf
->wmm_enabled
;
49 wconf
->wmm_uapsd
= conf
->wmm_uapsd
;
50 wconf
->disable_pmksa_caching
= conf
->disable_pmksa_caching
;
51 wconf
->okc
= conf
->okc
;
52 #ifdef CONFIG_IEEE80211W
53 wconf
->ieee80211w
= conf
->ieee80211w
;
54 wconf
->group_mgmt_cipher
= conf
->group_mgmt_cipher
;
55 #endif /* CONFIG_IEEE80211W */
56 #ifdef CONFIG_IEEE80211R
57 wconf
->ssid_len
= conf
->ssid
.ssid_len
;
58 if (wconf
->ssid_len
> SSID_MAX_LEN
)
59 wconf
->ssid_len
= SSID_MAX_LEN
;
60 os_memcpy(wconf
->ssid
, conf
->ssid
.ssid
, wconf
->ssid_len
);
61 os_memcpy(wconf
->mobility_domain
, conf
->mobility_domain
,
62 MOBILITY_DOMAIN_ID_LEN
);
63 if (conf
->nas_identifier
&&
64 os_strlen(conf
->nas_identifier
) <= FT_R0KH_ID_MAX_LEN
) {
65 wconf
->r0_key_holder_len
= os_strlen(conf
->nas_identifier
);
66 os_memcpy(wconf
->r0_key_holder
, conf
->nas_identifier
,
67 wconf
->r0_key_holder_len
);
69 os_memcpy(wconf
->r1_key_holder
, conf
->r1_key_holder
, FT_R1KH_ID_LEN
);
70 wconf
->r0_key_lifetime
= conf
->r0_key_lifetime
;
71 wconf
->reassociation_deadline
= conf
->reassociation_deadline
;
72 wconf
->r0kh_list
= conf
->r0kh_list
;
73 wconf
->r1kh_list
= conf
->r1kh_list
;
74 wconf
->pmk_r1_push
= conf
->pmk_r1_push
;
75 wconf
->ft_over_ds
= conf
->ft_over_ds
;
76 #endif /* CONFIG_IEEE80211R */
78 wconf
->disable_gtk
= conf
->disable_dgaf
;
80 wconf
->disable_gtk
= 1;
81 wconf
->wpa
= WPA_PROTO_OSEN
;
82 wconf
->wpa_key_mgmt
= WPA_KEY_MGMT_OSEN
;
83 wconf
->wpa_pairwise
= 0;
84 wconf
->wpa_group
= WPA_CIPHER_CCMP
;
85 wconf
->rsn_pairwise
= WPA_CIPHER_CCMP
;
86 wconf
->rsn_preauth
= 0;
87 wconf
->disable_pmksa_caching
= 1;
88 #ifdef CONFIG_IEEE80211W
89 wconf
->ieee80211w
= 1;
90 #endif /* CONFIG_IEEE80211W */
92 #endif /* CONFIG_HS20 */
93 #ifdef CONFIG_TESTING_OPTIONS
94 wconf
->corrupt_gtk_rekey_mic_probability
=
95 iconf
->corrupt_gtk_rekey_mic_probability
;
96 if (conf
->own_ie_override
&&
97 wpabuf_len(conf
->own_ie_override
) <= MAX_OWN_IE_OVERRIDE
) {
98 wconf
->own_ie_override_len
= wpabuf_len(conf
->own_ie_override
);
99 os_memcpy(wconf
->own_ie_override
,
100 wpabuf_head(conf
->own_ie_override
),
101 wconf
->own_ie_override_len
);
103 #endif /* CONFIG_TESTING_OPTIONS */
105 os_memcpy(wconf
->ip_addr_go
, conf
->ip_addr_go
, 4);
106 os_memcpy(wconf
->ip_addr_mask
, conf
->ip_addr_mask
, 4);
107 os_memcpy(wconf
->ip_addr_start
, conf
->ip_addr_start
, 4);
108 os_memcpy(wconf
->ip_addr_end
, conf
->ip_addr_end
, 4);
109 #endif /* CONFIG_P2P */
113 static void hostapd_wpa_auth_logger(void *ctx
, const u8
*addr
,
114 logger_level level
, const char *txt
)
116 #ifndef CONFIG_NO_HOSTAPD_LOGGER
117 struct hostapd_data
*hapd
= ctx
;
122 hlevel
= HOSTAPD_LEVEL_WARNING
;
125 hlevel
= HOSTAPD_LEVEL_INFO
;
129 hlevel
= HOSTAPD_LEVEL_DEBUG
;
133 hostapd_logger(hapd
, addr
, HOSTAPD_MODULE_WPA
, hlevel
, "%s", txt
);
134 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
138 static void hostapd_wpa_auth_disconnect(void *ctx
, const u8
*addr
,
141 struct hostapd_data
*hapd
= ctx
;
142 wpa_printf(MSG_DEBUG
, "%s: WPA authenticator requests disconnect: "
143 "STA " MACSTR
" reason %d",
144 __func__
, MAC2STR(addr
), reason
);
145 ap_sta_disconnect(hapd
, NULL
, addr
, reason
);
149 static int hostapd_wpa_auth_mic_failure_report(void *ctx
, const u8
*addr
)
151 struct hostapd_data
*hapd
= ctx
;
152 return michael_mic_failure(hapd
, addr
, 0);
156 static void hostapd_wpa_auth_psk_failure_report(void *ctx
, const u8
*addr
)
158 struct hostapd_data
*hapd
= ctx
;
159 wpa_msg(hapd
->msg_ctx
, MSG_INFO
, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR
,
164 static void hostapd_wpa_auth_set_eapol(void *ctx
, const u8
*addr
,
165 wpa_eapol_variable var
, int value
)
167 struct hostapd_data
*hapd
= ctx
;
168 struct sta_info
*sta
= ap_get_sta(hapd
, addr
);
172 case WPA_EAPOL_portEnabled
:
173 ieee802_1x_notify_port_enabled(sta
->eapol_sm
, value
);
175 case WPA_EAPOL_portValid
:
176 ieee802_1x_notify_port_valid(sta
->eapol_sm
, value
);
178 case WPA_EAPOL_authorized
:
179 ieee802_1x_set_sta_authorized(hapd
, sta
, value
);
181 case WPA_EAPOL_portControl_Auto
:
183 sta
->eapol_sm
->portControl
= Auto
;
185 case WPA_EAPOL_keyRun
:
187 sta
->eapol_sm
->keyRun
= value
? TRUE
: FALSE
;
189 case WPA_EAPOL_keyAvailable
:
191 sta
->eapol_sm
->eap_if
->eapKeyAvailable
=
192 value
? TRUE
: FALSE
;
194 case WPA_EAPOL_keyDone
:
196 sta
->eapol_sm
->keyDone
= value
? TRUE
: FALSE
;
198 case WPA_EAPOL_inc_EapolFramesTx
:
200 sta
->eapol_sm
->dot1xAuthEapolFramesTx
++;
206 static int hostapd_wpa_auth_get_eapol(void *ctx
, const u8
*addr
,
207 wpa_eapol_variable var
)
209 struct hostapd_data
*hapd
= ctx
;
210 struct sta_info
*sta
= ap_get_sta(hapd
, addr
);
211 if (sta
== NULL
|| sta
->eapol_sm
== NULL
)
214 case WPA_EAPOL_keyRun
:
215 return sta
->eapol_sm
->keyRun
;
216 case WPA_EAPOL_keyAvailable
:
217 return sta
->eapol_sm
->eap_if
->eapKeyAvailable
;
224 static const u8
* hostapd_wpa_auth_get_psk(void *ctx
, const u8
*addr
,
225 const u8
*p2p_dev_addr
,
228 struct hostapd_data
*hapd
= ctx
;
229 struct sta_info
*sta
= ap_get_sta(hapd
, addr
);
233 if (sta
&& sta
->auth_alg
== WLAN_AUTH_SAE
) {
234 if (!sta
->sae
|| prev_psk
)
236 return sta
->sae
->pmk
;
238 #endif /* CONFIG_SAE */
240 psk
= hostapd_get_psk(hapd
->conf
, addr
, p2p_dev_addr
, prev_psk
);
242 * This is about to iterate over all psks, prev_psk gives the last
243 * returned psk which should not be returned again.
244 * logic list (all hostapd_get_psk; all sta->psk)
246 if (sta
&& sta
->psk
&& !psk
) {
247 struct hostapd_sta_wpa_psk_short
*pos
;
249 for (pos
= sta
->psk
; pos
; pos
= pos
->next
) {
250 if (pos
->is_passphrase
) {
251 pbkdf2_sha1(pos
->passphrase
,
252 hapd
->conf
->ssid
.ssid
,
253 hapd
->conf
->ssid
.ssid_len
, 4096,
255 pos
->is_passphrase
= 0;
257 if (pos
->psk
== prev_psk
) {
258 psk
= pos
->next
? pos
->next
->psk
: NULL
;
267 static int hostapd_wpa_auth_get_msk(void *ctx
, const u8
*addr
, u8
*msk
,
270 struct hostapd_data
*hapd
= ctx
;
273 struct sta_info
*sta
;
275 sta
= ap_get_sta(hapd
, addr
);
277 wpa_printf(MSG_DEBUG
, "AUTH_GET_MSK: Cannot find STA");
281 key
= ieee802_1x_get_key(sta
->eapol_sm
, &keylen
);
283 wpa_printf(MSG_DEBUG
, "AUTH_GET_MSK: Key is null, eapol_sm: %p",
290 os_memcpy(msk
, key
, keylen
);
297 static int hostapd_wpa_auth_set_key(void *ctx
, int vlan_id
, enum wpa_alg alg
,
298 const u8
*addr
, int idx
, u8
*key
,
301 struct hostapd_data
*hapd
= ctx
;
302 const char *ifname
= hapd
->conf
->iface
;
305 ifname
= hostapd_get_vlan_id_ifname(hapd
->conf
->vlan
, vlan_id
);
310 return hostapd_drv_set_key(ifname
, hapd
, alg
, addr
, idx
, 1, NULL
, 0,
315 static int hostapd_wpa_auth_get_seqnum(void *ctx
, const u8
*addr
, int idx
,
318 struct hostapd_data
*hapd
= ctx
;
319 return hostapd_get_seqnum(hapd
->conf
->iface
, hapd
, addr
, idx
, seq
);
323 static int hostapd_wpa_auth_send_eapol(void *ctx
, const u8
*addr
,
324 const u8
*data
, size_t data_len
,
327 struct hostapd_data
*hapd
= ctx
;
328 struct sta_info
*sta
;
331 #ifdef CONFIG_TESTING_OPTIONS
332 if (hapd
->ext_eapol_frame_io
) {
333 size_t hex_len
= 2 * data_len
+ 1;
334 char *hex
= os_malloc(hex_len
);
338 wpa_snprintf_hex(hex
, hex_len
, data
, data_len
);
339 wpa_msg(hapd
->msg_ctx
, MSG_INFO
, "EAPOL-TX " MACSTR
" %s",
344 #endif /* CONFIG_TESTING_OPTIONS */
346 sta
= ap_get_sta(hapd
, addr
);
348 flags
= hostapd_sta_flags_to_drv(sta
->flags
);
350 return hostapd_drv_hapd_send_eapol(hapd
, addr
, data
, data_len
,
355 static int hostapd_wpa_auth_for_each_sta(
356 void *ctx
, int (*cb
)(struct wpa_state_machine
*sm
, void *ctx
),
359 struct hostapd_data
*hapd
= ctx
;
360 struct sta_info
*sta
;
362 for (sta
= hapd
->sta_list
; sta
; sta
= sta
->next
) {
363 if (sta
->wpa_sm
&& cb(sta
->wpa_sm
, cb_ctx
))
370 struct wpa_auth_iface_iter_data
{
371 int (*cb
)(struct wpa_authenticator
*sm
, void *ctx
);
375 static int wpa_auth_iface_iter(struct hostapd_iface
*iface
, void *ctx
)
377 struct wpa_auth_iface_iter_data
*data
= ctx
;
379 for (i
= 0; i
< iface
->num_bss
; i
++) {
380 if (iface
->bss
[i
]->wpa_auth
&&
381 data
->cb(iface
->bss
[i
]->wpa_auth
, data
->cb_ctx
))
388 static int hostapd_wpa_auth_for_each_auth(
389 void *ctx
, int (*cb
)(struct wpa_authenticator
*sm
, void *ctx
),
392 struct hostapd_data
*hapd
= ctx
;
393 struct wpa_auth_iface_iter_data data
;
394 if (hapd
->iface
->interfaces
== NULL
||
395 hapd
->iface
->interfaces
->for_each_interface
== NULL
)
398 data
.cb_ctx
= cb_ctx
;
399 return hapd
->iface
->interfaces
->for_each_interface(
400 hapd
->iface
->interfaces
, wpa_auth_iface_iter
, &data
);
404 #ifdef CONFIG_IEEE80211R
406 struct wpa_auth_ft_iface_iter_data
{
407 struct hostapd_data
*src_hapd
;
414 static int hostapd_wpa_auth_ft_iter(struct hostapd_iface
*iface
, void *ctx
)
416 struct wpa_auth_ft_iface_iter_data
*idata
= ctx
;
417 struct hostapd_data
*hapd
;
420 for (j
= 0; j
< iface
->num_bss
; j
++) {
421 hapd
= iface
->bss
[j
];
422 if (hapd
== idata
->src_hapd
)
426 if (os_memcmp(hapd
->own_addr
, idata
->dst
, ETH_ALEN
) == 0) {
427 wpa_printf(MSG_DEBUG
, "FT: Send RRB data directly to "
428 "locally managed BSS " MACSTR
"@%s -> "
430 MAC2STR(idata
->src_hapd
->own_addr
),
431 idata
->src_hapd
->conf
->iface
,
432 MAC2STR(hapd
->own_addr
), hapd
->conf
->iface
);
433 wpa_ft_rrb_rx(hapd
->wpa_auth
,
434 idata
->src_hapd
->own_addr
,
435 idata
->data
, idata
->data_len
);
443 #endif /* CONFIG_IEEE80211R */
446 static int hostapd_wpa_auth_send_ether(void *ctx
, const u8
*dst
, u16 proto
,
447 const u8
*data
, size_t data_len
)
449 struct hostapd_data
*hapd
= ctx
;
450 struct l2_ethhdr
*buf
;
453 #ifdef CONFIG_TESTING_OPTIONS
454 if (hapd
->ext_eapol_frame_io
&& proto
== ETH_P_EAPOL
) {
455 size_t hex_len
= 2 * data_len
+ 1;
456 char *hex
= os_malloc(hex_len
);
460 wpa_snprintf_hex(hex
, hex_len
, data
, data_len
);
461 wpa_msg(hapd
->msg_ctx
, MSG_INFO
, "EAPOL-TX " MACSTR
" %s",
466 #endif /* CONFIG_TESTING_OPTIONS */
468 #ifdef CONFIG_IEEE80211R
469 if (proto
== ETH_P_RRB
&& hapd
->iface
->interfaces
&&
470 hapd
->iface
->interfaces
->for_each_interface
) {
472 struct wpa_auth_ft_iface_iter_data idata
;
473 idata
.src_hapd
= hapd
;
476 idata
.data_len
= data_len
;
477 res
= hapd
->iface
->interfaces
->for_each_interface(
478 hapd
->iface
->interfaces
, hostapd_wpa_auth_ft_iter
,
483 #endif /* CONFIG_IEEE80211R */
485 if (hapd
->driver
&& hapd
->driver
->send_ether
)
486 return hapd
->driver
->send_ether(hapd
->drv_priv
, dst
,
487 hapd
->own_addr
, proto
,
489 if (hapd
->l2
== NULL
)
492 buf
= os_malloc(sizeof(*buf
) + data_len
);
495 os_memcpy(buf
->h_dest
, dst
, ETH_ALEN
);
496 os_memcpy(buf
->h_source
, hapd
->own_addr
, ETH_ALEN
);
497 buf
->h_proto
= host_to_be16(proto
);
498 os_memcpy(buf
+ 1, data
, data_len
);
499 ret
= l2_packet_send(hapd
->l2
, dst
, proto
, (u8
*) buf
,
500 sizeof(*buf
) + data_len
);
506 #ifdef CONFIG_IEEE80211R
508 static int hostapd_wpa_auth_send_ft_action(void *ctx
, const u8
*dst
,
509 const u8
*data
, size_t data_len
)
511 struct hostapd_data
*hapd
= ctx
;
513 struct ieee80211_mgmt
*m
;
515 struct sta_info
*sta
;
517 sta
= ap_get_sta(hapd
, dst
);
518 if (sta
== NULL
|| sta
->wpa_sm
== NULL
)
521 m
= os_zalloc(sizeof(*m
) + data_len
);
524 mlen
= ((u8
*) &m
->u
- (u8
*) m
) + data_len
;
525 m
->frame_control
= IEEE80211_FC(WLAN_FC_TYPE_MGMT
,
526 WLAN_FC_STYPE_ACTION
);
527 os_memcpy(m
->da
, dst
, ETH_ALEN
);
528 os_memcpy(m
->sa
, hapd
->own_addr
, ETH_ALEN
);
529 os_memcpy(m
->bssid
, hapd
->own_addr
, ETH_ALEN
);
530 os_memcpy(&m
->u
, data
, data_len
);
532 res
= hostapd_drv_send_mlme(hapd
, (u8
*) m
, mlen
, 0);
538 static struct wpa_state_machine
*
539 hostapd_wpa_auth_add_sta(void *ctx
, const u8
*sta_addr
)
541 struct hostapd_data
*hapd
= ctx
;
542 struct sta_info
*sta
;
544 if (hostapd_add_sta_node(hapd
, sta_addr
, WLAN_AUTH_FT
) < 0)
547 sta
= ap_sta_add(hapd
, sta_addr
);
551 sta
->auth_alg
= WLAN_AUTH_FT
;
555 sta
->wpa_sm
= wpa_auth_sta_init(hapd
->wpa_auth
, sta
->addr
, NULL
);
556 if (sta
->wpa_sm
== NULL
) {
557 ap_free_sta(hapd
, sta
);
560 sta
->auth_alg
= WLAN_AUTH_FT
;
566 static void hostapd_rrb_receive(void *ctx
, const u8
*src_addr
, const u8
*buf
,
569 struct hostapd_data
*hapd
= ctx
;
570 struct l2_ethhdr
*ethhdr
;
571 if (len
< sizeof(*ethhdr
))
573 ethhdr
= (struct l2_ethhdr
*) buf
;
574 wpa_printf(MSG_DEBUG
, "FT: RRB received packet " MACSTR
" -> "
575 MACSTR
, MAC2STR(ethhdr
->h_source
), MAC2STR(ethhdr
->h_dest
));
576 if (!is_multicast_ether_addr(ethhdr
->h_dest
) &&
577 os_memcmp(hapd
->own_addr
, ethhdr
->h_dest
, ETH_ALEN
) != 0)
579 wpa_ft_rrb_rx(hapd
->wpa_auth
, ethhdr
->h_source
, buf
+ sizeof(*ethhdr
),
580 len
- sizeof(*ethhdr
));
584 static int hostapd_wpa_auth_add_tspec(void *ctx
, const u8
*sta_addr
,
585 u8
*tspec_ie
, size_t tspec_ielen
)
587 struct hostapd_data
*hapd
= ctx
;
588 return hostapd_add_tspec(hapd
, sta_addr
, tspec_ie
, tspec_ielen
);
591 #endif /* CONFIG_IEEE80211R */
594 int hostapd_setup_wpa(struct hostapd_data
*hapd
)
596 struct wpa_auth_config _conf
;
597 struct wpa_auth_callbacks cb
;
601 hostapd_wpa_auth_conf(hapd
->conf
, hapd
->iconf
, &_conf
);
602 if (hapd
->iface
->drv_flags
& WPA_DRIVER_FLAGS_EAPOL_TX_STATUS
)
604 if (hapd
->iface
->drv_flags
& WPA_DRIVER_FLAGS_AP_MLME
)
606 os_memset(&cb
, 0, sizeof(cb
));
608 cb
.logger
= hostapd_wpa_auth_logger
;
609 cb
.disconnect
= hostapd_wpa_auth_disconnect
;
610 cb
.mic_failure_report
= hostapd_wpa_auth_mic_failure_report
;
611 cb
.psk_failure_report
= hostapd_wpa_auth_psk_failure_report
;
612 cb
.set_eapol
= hostapd_wpa_auth_set_eapol
;
613 cb
.get_eapol
= hostapd_wpa_auth_get_eapol
;
614 cb
.get_psk
= hostapd_wpa_auth_get_psk
;
615 cb
.get_msk
= hostapd_wpa_auth_get_msk
;
616 cb
.set_key
= hostapd_wpa_auth_set_key
;
617 cb
.get_seqnum
= hostapd_wpa_auth_get_seqnum
;
618 cb
.send_eapol
= hostapd_wpa_auth_send_eapol
;
619 cb
.for_each_sta
= hostapd_wpa_auth_for_each_sta
;
620 cb
.for_each_auth
= hostapd_wpa_auth_for_each_auth
;
621 cb
.send_ether
= hostapd_wpa_auth_send_ether
;
622 #ifdef CONFIG_IEEE80211R
623 cb
.send_ft_action
= hostapd_wpa_auth_send_ft_action
;
624 cb
.add_sta
= hostapd_wpa_auth_add_sta
;
625 cb
.add_tspec
= hostapd_wpa_auth_add_tspec
;
626 #endif /* CONFIG_IEEE80211R */
627 hapd
->wpa_auth
= wpa_init(hapd
->own_addr
, &_conf
, &cb
);
628 if (hapd
->wpa_auth
== NULL
) {
629 wpa_printf(MSG_ERROR
, "WPA initialization failed.");
633 if (hostapd_set_privacy(hapd
, 1)) {
634 wpa_printf(MSG_ERROR
, "Could not set PrivacyInvoked "
635 "for interface %s", hapd
->conf
->iface
);
639 wpa_ie
= wpa_auth_get_wpa_ie(hapd
->wpa_auth
, &wpa_ie_len
);
640 if (hostapd_set_generic_elem(hapd
, wpa_ie
, wpa_ie_len
)) {
641 wpa_printf(MSG_ERROR
, "Failed to configure WPA IE for "
642 "the kernel driver.");
646 if (rsn_preauth_iface_init(hapd
)) {
647 wpa_printf(MSG_ERROR
, "Initialization of RSN "
648 "pre-authentication failed.");
652 #ifdef CONFIG_IEEE80211R
653 if (!hostapd_drv_none(hapd
) &&
654 wpa_key_mgmt_ft(hapd
->conf
->wpa_key_mgmt
)) {
655 hapd
->l2
= l2_packet_init(hapd
->conf
->bridge
[0] ?
657 hapd
->conf
->iface
, NULL
, ETH_P_RRB
,
658 hostapd_rrb_receive
, hapd
, 1);
659 if (hapd
->l2
== NULL
&&
660 (hapd
->driver
== NULL
||
661 hapd
->driver
->send_ether
== NULL
)) {
662 wpa_printf(MSG_ERROR
, "Failed to open l2_packet "
667 #endif /* CONFIG_IEEE80211R */
674 void hostapd_reconfig_wpa(struct hostapd_data
*hapd
)
676 struct wpa_auth_config wpa_auth_conf
;
677 hostapd_wpa_auth_conf(hapd
->conf
, hapd
->iconf
, &wpa_auth_conf
);
678 wpa_reconfig(hapd
->wpa_auth
, &wpa_auth_conf
);
682 void hostapd_deinit_wpa(struct hostapd_data
*hapd
)
684 ieee80211_tkip_countermeasures_deinit(hapd
);
685 rsn_preauth_iface_deinit(hapd
);
686 if (hapd
->wpa_auth
) {
687 wpa_deinit(hapd
->wpa_auth
);
688 hapd
->wpa_auth
= NULL
;
690 if (hapd
->drv_priv
&& hostapd_set_privacy(hapd
, 0)) {
691 wpa_printf(MSG_DEBUG
, "Could not disable "
692 "PrivacyInvoked for interface %s",
696 if (hapd
->drv_priv
&&
697 hostapd_set_generic_elem(hapd
, (u8
*) "", 0)) {
698 wpa_printf(MSG_DEBUG
, "Could not remove generic "
699 "information element from interface %s",
703 ieee802_1x_deinit(hapd
);
705 #ifdef CONFIG_IEEE80211R
706 l2_packet_deinit(hapd
->l2
);
708 #endif /* CONFIG_IEEE80211R */