mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
hostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed
As long as WLAN_STA_ASSOC_REQ_OK is set in sta->flags, Class 3 frames do not trigger a disassoc/deauth. If it is still set even after the assoc response tx has already failed, it may take somewhat longer for clients to realize that the connection wasn't fully established. Signed-hostap: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
dd31eb79a2
commit
22b42372d0
@ -1506,13 +1506,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
|
|||||||
int new_assoc = 1;
|
int new_assoc = 1;
|
||||||
struct ieee80211_ht_capabilities ht_cap;
|
struct ieee80211_ht_capabilities ht_cap;
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
|
||||||
HOSTAPD_LEVEL_DEBUG,
|
|
||||||
"did not acknowledge association response");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
|
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
|
||||||
sizeof(mgmt->u.assoc_resp))) {
|
sizeof(mgmt->u.assoc_resp))) {
|
||||||
printf("handle_assoc_cb(reassoc=%d) - too short payload "
|
printf("handle_assoc_cb(reassoc=%d) - too short payload "
|
||||||
@ -1520,11 +1513,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reassoc)
|
|
||||||
status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
|
||||||
else
|
|
||||||
status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
|
||||||
|
|
||||||
sta = ap_get_sta(hapd, mgmt->da);
|
sta = ap_get_sta(hapd, mgmt->da);
|
||||||
if (!sta) {
|
if (!sta) {
|
||||||
printf("handle_assoc_cb: STA " MACSTR " not found\n",
|
printf("handle_assoc_cb: STA " MACSTR " not found\n",
|
||||||
@ -1532,6 +1520,19 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
|
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
|
||||||
|
HOSTAPD_LEVEL_DEBUG,
|
||||||
|
"did not acknowledge association response");
|
||||||
|
sta->flags &= ~WLAN_STA_ASSOC_REQ_OK;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reassoc)
|
||||||
|
status = le_to_host16(mgmt->u.reassoc_resp.status_code);
|
||||||
|
else
|
||||||
|
status = le_to_host16(mgmt->u.assoc_resp.status_code);
|
||||||
|
|
||||||
if (status != WLAN_STATUS_SUCCESS)
|
if (status != WLAN_STATUS_SUCCESS)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user