mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 11:33:04 -05:00
WNM: Add STA flag to indicate the current WNM-Sleep-Mode state
This can be useful for displaying the current STA state and also for determining whether some operations are likely to fail or need additional delay. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
477689788c
commit
3578e665bf
@ -103,7 +103,7 @@ static void hostapd_dump_state(struct hostapd_data *hapd)
|
|||||||
fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
|
fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
|
||||||
|
|
||||||
fprintf(f,
|
fprintf(f,
|
||||||
" AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
|
" AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
|
||||||
"\n"
|
"\n"
|
||||||
" capability=0x%x listen_interval=%d\n",
|
" capability=0x%x listen_interval=%d\n",
|
||||||
sta->aid,
|
sta->aid,
|
||||||
@ -126,6 +126,10 @@ static void hostapd_dump_state(struct hostapd_data *hapd)
|
|||||||
(sta->flags & WLAN_STA_WDS ? "[WDS]" : ""),
|
(sta->flags & WLAN_STA_WDS ? "[WDS]" : ""),
|
||||||
(sta->flags & WLAN_STA_NONERP ? "[NonERP]" : ""),
|
(sta->flags & WLAN_STA_NONERP ? "[NonERP]" : ""),
|
||||||
(sta->flags & WLAN_STA_WPS2 ? "[WPS2]" : ""),
|
(sta->flags & WLAN_STA_WPS2 ? "[WPS2]" : ""),
|
||||||
|
(sta->flags & WLAN_STA_GAS ? "[GAS]" : ""),
|
||||||
|
(sta->flags & WLAN_STA_VHT ? "[VHT]" : ""),
|
||||||
|
(sta->flags & WLAN_STA_WNM_SLEEP_MODE ?
|
||||||
|
"[WNM_SLEEP_MODE]" : ""),
|
||||||
sta->capability,
|
sta->capability,
|
||||||
sta->listen_interval);
|
sta->listen_interval);
|
||||||
|
|
||||||
|
@ -299,6 +299,7 @@ skip_wpa_check:
|
|||||||
|
|
||||||
new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
|
new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
|
||||||
sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
|
sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
|
||||||
|
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
|
||||||
|
|
||||||
if (reassoc && (sta->auth_alg == WLAN_AUTH_FT))
|
if (reassoc && (sta->auth_alg == WLAN_AUTH_FT))
|
||||||
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT);
|
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT);
|
||||||
|
@ -1931,6 +1931,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
|
|||||||
if (sta->flags & WLAN_STA_ASSOC)
|
if (sta->flags & WLAN_STA_ASSOC)
|
||||||
new_assoc = 0;
|
new_assoc = 0;
|
||||||
sta->flags |= WLAN_STA_ASSOC;
|
sta->flags |= WLAN_STA_ASSOC;
|
||||||
|
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
|
||||||
if ((!hapd->conf->ieee802_1x && !hapd->conf->wpa) ||
|
if ((!hapd->conf->ieee802_1x && !hapd->conf->wpa) ||
|
||||||
sta->auth_alg == WLAN_AUTH_FT) {
|
sta->auth_alg == WLAN_AUTH_FT) {
|
||||||
/*
|
/*
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#define WLAN_STA_WPS2 BIT(16)
|
#define WLAN_STA_WPS2 BIT(16)
|
||||||
#define WLAN_STA_GAS BIT(17)
|
#define WLAN_STA_GAS BIT(17)
|
||||||
#define WLAN_STA_VHT BIT(18)
|
#define WLAN_STA_VHT BIT(18)
|
||||||
|
#define WLAN_STA_WNM_SLEEP_MODE BIT(19)
|
||||||
#define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
|
#define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
|
||||||
#define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
|
#define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
|
||||||
#define WLAN_STA_NONERP BIT(31)
|
#define WLAN_STA_NONERP BIT(31)
|
||||||
|
@ -155,6 +155,7 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd,
|
|||||||
*/
|
*/
|
||||||
if (wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT &&
|
if (wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT &&
|
||||||
wnmsleep_ie.action_type == WNM_SLEEP_MODE_ENTER) {
|
wnmsleep_ie.action_type == WNM_SLEEP_MODE_ENTER) {
|
||||||
|
sta->flags |= WLAN_STA_WNM_SLEEP_MODE;
|
||||||
hostapd_drv_wnm_oper(hapd, WNM_SLEEP_ENTER_CONFIRM,
|
hostapd_drv_wnm_oper(hapd, WNM_SLEEP_ENTER_CONFIRM,
|
||||||
addr, NULL, NULL);
|
addr, NULL, NULL);
|
||||||
wpa_set_wnmsleep(sta->wpa_sm, 1);
|
wpa_set_wnmsleep(sta->wpa_sm, 1);
|
||||||
@ -168,6 +169,7 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd,
|
|||||||
wnmsleep_ie.status ==
|
wnmsleep_ie.status ==
|
||||||
WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) &&
|
WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) &&
|
||||||
wnmsleep_ie.action_type == WNM_SLEEP_MODE_EXIT) {
|
wnmsleep_ie.action_type == WNM_SLEEP_MODE_EXIT) {
|
||||||
|
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
|
||||||
wpa_set_wnmsleep(sta->wpa_sm, 0);
|
wpa_set_wnmsleep(sta->wpa_sm, 0);
|
||||||
hostapd_drv_wnm_oper(hapd, WNM_SLEEP_EXIT_CONFIRM,
|
hostapd_drv_wnm_oper(hapd, WNM_SLEEP_EXIT_CONFIRM,
|
||||||
addr, NULL, NULL);
|
addr, NULL, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user