From: Michael Braun <michael-dev@xxxxxxxxxxxxx> This adds a station to the driver when doing FT OVER-DS. Signed-off-by: Michael Braun <michael-dev@xxxxxxxxxxxxx> --- src/ap/sta_info.c | 8 +++++++- src/ap/wpa_auth_glue.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index a3ff592..0ccaf62 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -994,7 +994,13 @@ skip_counting: if (wpa_auth_sta_set_vlan(sta->wpa_sm, sta->vlan_id) < 0) wpa_printf(MSG_INFO, "Failed to update VLAN-ID for WPA"); - if (sta->flags & (WLAN_STA_AUTH | WLAN_STA_ASSOC)) { + /* if station is auth or assoc OR + * if station is FT_OVER_DS preauth and FULL_AP_CLIENT_STATE supported + * -> bind vlan + */ + if ((sta->flags & (WLAN_STA_AUTH | WLAN_STA_ASSOC)) || + ((sta->flags & WLAN_STA_PREAUTH_FT_OVER_DS) && + FULL_AP_CLIENT_STATE_SUPP(hapd->iface->drv_flags))) { ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, sta->vlan_id); if (ret < 0) diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c index 3133713..c19a9c7 100644 --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c @@ -647,6 +647,41 @@ hostapd_wpa_auth_add_sta_auth(void *ctx, const u8 *sta_addr, ieee802_1x_notify_pre_auth(sta->eapol_sm, 0); + /* + * If the driver supports full AP client state, add a station to the + * driver before sending authentication reply to make sure the driver + * has resources, and not to go through the entire authentication and + * association handshake, and fail it at the end. + * + * Additionally, this enables OVER_DS to configure station vlan early. + */ + if (FULL_AP_CLIENT_STATE_SUPP(hapd->iface->drv_flags) && + !(sta->added_unassoc)) { + /* + * If a station that is already associated to the AP, is trying + * to authenticate again, remove the STA entry, in order to make + * sure the STA PS state gets cleared and configuration gets + * updated. To handle this, station's added_unassoc flag is + * cleared once the station has completed association. + */ + hostapd_drv_sta_remove(hapd, sta->addr); + sta->flags &= ~(WLAN_STA_ASSOC | WLAN_STA_AUTH | + WLAN_STA_AUTHORIZED | + WLAN_STA_PREAUTH_FT_OVER_DS); + + if (hostapd_sta_add(hapd, sta->addr, 0, 0, 0, 0, 0, + NULL, NULL, sta->flags, 0, 0, 0)) { + hostapd_logger(hapd, sta->addr, + HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_NOTICE, + "Could not add STA to kernel driver"); + res = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; + goto fail; + } + + sta->added_unassoc = 1; + } + return 0; fail: hostapd_allowed_address_free(&info); -- 1.9.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap