mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
hostapd: Set STA flags when adding a new station
When adding a new station, set the STA flags as part of the sta_add() command. This ensures the flags are up to date when the station is added by lower level drivers. Signed-off-by: Arik Nemtsov <arik@wizery.com>
This commit is contained in:
parent
ed49fbbf3a
commit
d83ab1fe37
@ -314,7 +314,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
const u8 *addr, u16 aid, u16 capability,
|
const u8 *addr, u16 aid, u16 capability,
|
||||||
const u8 *supp_rates, size_t supp_rates_len,
|
const u8 *supp_rates, size_t supp_rates_len,
|
||||||
u16 listen_interval,
|
u16 listen_interval,
|
||||||
const struct ieee80211_ht_capabilities *ht_capab)
|
const struct ieee80211_ht_capabilities *ht_capab,
|
||||||
|
u32 flags)
|
||||||
{
|
{
|
||||||
struct hostapd_sta_add_params params;
|
struct hostapd_sta_add_params params;
|
||||||
|
|
||||||
@ -331,6 +332,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
params.supp_rates_len = supp_rates_len;
|
params.supp_rates_len = supp_rates_len;
|
||||||
params.listen_interval = listen_interval;
|
params.listen_interval = listen_interval;
|
||||||
params.ht_capabilities = ht_capab;
|
params.ht_capabilities = ht_capab;
|
||||||
|
params.flags = hostapd_sta_flags_to_drv(flags);
|
||||||
return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
|
return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
const u8 *addr, u16 aid, u16 capability,
|
const u8 *addr, u16 aid, u16 capability,
|
||||||
const u8 *supp_rates, size_t supp_rates_len,
|
const u8 *supp_rates, size_t supp_rates_len,
|
||||||
u16 listen_interval,
|
u16 listen_interval,
|
||||||
const struct ieee80211_ht_capabilities *ht_capab);
|
const struct ieee80211_ht_capabilities *ht_capab,
|
||||||
|
u32 flags);
|
||||||
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
|
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
|
||||||
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
|
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
|
||||||
size_t elem_len);
|
size_t elem_len);
|
||||||
|
@ -1705,7 +1705,8 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
|
|||||||
if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability,
|
if (hostapd_sta_add(hapd, sta->addr, sta->aid, sta->capability,
|
||||||
sta->supported_rates, sta->supported_rates_len,
|
sta->supported_rates, sta->supported_rates_len,
|
||||||
sta->listen_interval,
|
sta->listen_interval,
|
||||||
sta->flags & WLAN_STA_HT ? &ht_cap : NULL)) {
|
sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
|
||||||
|
sta->flags)) {
|
||||||
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_NOTICE,
|
HOSTAPD_LEVEL_NOTICE,
|
||||||
"Could not add STA to kernel driver");
|
"Could not add STA to kernel driver");
|
||||||
|
@ -602,6 +602,7 @@ struct hostapd_sta_add_params {
|
|||||||
size_t supp_rates_len;
|
size_t supp_rates_len;
|
||||||
u16 listen_interval;
|
u16 listen_interval;
|
||||||
const struct ieee80211_ht_capabilities *ht_capabilities;
|
const struct ieee80211_ht_capabilities *ht_capabilities;
|
||||||
|
u32 flags; /* bitmask of WPA_STA_* flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hostapd_freq_params {
|
struct hostapd_freq_params {
|
||||||
|
Loading…
Reference in New Issue
Block a user