--- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3152,6 +3152,8 @@ static int hostapd_config_fill(struct ho bss->ft_over_ds = atoi(pos); } else if (os_strcmp(buf, "ft_psk_generate_local") == 0) { bss->ft_psk_generate_local = atoi(pos); + } else if (os_strcmp(buf, "ft_l2_refresh") == 0) { + bss->ft_l2_refresh = atoi(pos); #endif /* CONFIG_IEEE80211R_AP */ #ifndef CONFIG_NO_CTRL_IFACE } else if (os_strcmp(buf, "ctrl_interface") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -401,6 +401,7 @@ struct hostapd_bss_config { int pmk_r1_push; int ft_over_ds; int ft_psk_generate_local; + int ft_l2_refresh; int r1_max_key_lifetime; #endif /* CONFIG_IEEE80211R_AP */ --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c @@ -1495,6 +1495,28 @@ static void hostapd_request_radius_psk(v #endif /* CONFIG_NO_RADIUS */ +static void wpa_ft_refresh(void *eloop_data, void *user_data) +{ + struct hostapd_data *hapd = eloop_data; + struct ft_rrb_frame *frame; + struct l2_ethhdr *buf; + size_t len; + + len = sizeof(*buf) + sizeof(*frame); + buf = os_zalloc(len); + frame = (struct ft_rrb_frame *)(buf + 1); + frame->frame_type = RSN_REMOTE_FRAME_TYPE_FT_RRB; + frame->packet_type = FT_PACKET_REQUEST; + memset(buf->h_dest, 0xff, ETH_ALEN); + os_memcpy(buf->h_source, hapd->own_addr, ETH_ALEN); + buf->h_proto = host_to_be16(ETH_P_RRB); + l2_packet_send(hapd->l2, buf->h_dest, ETH_P_RRB, (u8 *) buf, len); + os_free(buf); + + eloop_register_timeout(hapd->conf->ft_l2_refresh, 0, wpa_ft_refresh, + hapd, NULL); +} + int hostapd_setup_wpa(struct hostapd_data *hapd) { struct wpa_auth_config _conf; @@ -1640,6 +1662,9 @@ int hostapd_setup_wpa(struct hostapd_dat "Failed to open ETH_P_OUI interface"); return -1; } + + if (hapd->conf->ft_l2_refresh) + wpa_ft_refresh(hapd, NULL); } #endif /* CONFIG_IEEE80211R_AP */ @@ -1655,7 +1680,6 @@ void hostapd_reconfig_wpa(struct hostapd wpa_reconfig(hapd->wpa_auth, &wpa_auth_conf); } - void hostapd_deinit_wpa(struct hostapd_data *hapd) { ieee80211_tkip_countermeasures_deinit(hapd); @@ -1679,6 +1703,7 @@ void hostapd_deinit_wpa(struct hostapd_d "information element from interface %s", hapd->conf->iface); } + } ieee802_1x_deinit(hapd); @@ -1687,6 +1712,7 @@ void hostapd_deinit_wpa(struct hostapd_d hostapd_wpa_ft_rrb_rx_later(hapd, NULL); /* flush without delivering */ eloop_cancel_timeout(hostapd_oui_deliver_later, hapd, ELOOP_ALL_CTX); hostapd_oui_deliver_later(hapd, NULL); /* flush without delivering */ + eloop_cancel_timeout(wpa_ft_refresh, hapd, ELOOP_ALL_CTX); l2_packet_deinit(hapd->l2); hapd->l2 = NULL; hostapd_wpa_unregister_ft_oui(hapd);