blob: 80b23bdfc964c3f614d14cda7deac78f2056ec9a [file] [log] [blame]
developer7b43f2d2022-04-29 17:53:25 +08001--- a/src/ap/ieee802_11.c
2+++ b/src/ap/ieee802_11.c
developer198585d2022-09-22 17:12:54 +08003@@ -4963,6 +4963,13 @@ static int add_associated_sta(struct hos
developer7b43f2d2022-04-29 17:53:25 +08004 * drivers to accept the STA parameter configuration. Since this is
5 * after a new FT-over-DS exchange, a new TK has been derived, so key
6 * reinstallation is not a concern for this case.
7+ *
8+ * If the STA was associated and authorized earlier, but came for a new
9+ * connection (!added_unassoc + !reassoc), remove the existing STA entry
10+ * so that it can be re-added. This case is rarely seen when the AP could
11+ * not receive the deauth/disassoc frame from the STA. And the STA comes
12+ * back with new connection within a short period or before the inactive
13+ * STA entry is removed from the list.
14 */
15 wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
16 " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
developer198585d2022-09-22 17:12:54 +080017@@ -4976,7 +4983,8 @@ static int add_associated_sta(struct hos
developer7b43f2d2022-04-29 17:53:25 +080018 (!(sta->flags & WLAN_STA_AUTHORIZED) ||
19 (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
20 (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
21- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) {
22+ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) ||
23+ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) {
24 hostapd_drv_sta_remove(hapd, sta->addr);
25 wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
26 set = 0;