mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 10:54:03 -05:00
hostapd: Fix endian bugs in STA HT capability handling
This commit is contained in:
parent
c6313c7505
commit
9510f00ff8
@ -1586,24 +1586,16 @@ hostapd_get_ht_capab(struct hostapd_data *hapd,
|
|||||||
struct ht_cap_ie *ht_cap_ie,
|
struct ht_cap_ie *ht_cap_ie,
|
||||||
struct ht_cap_ie *neg_ht_cap_ie)
|
struct ht_cap_ie *neg_ht_cap_ie)
|
||||||
{
|
{
|
||||||
|
u16 cap;
|
||||||
|
|
||||||
os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie));
|
os_memcpy(neg_ht_cap_ie, ht_cap_ie, sizeof(struct ht_cap_ie));
|
||||||
neg_ht_cap_ie->data.capabilities_info =
|
cap = le_to_host16(neg_ht_cap_ie->data.capabilities_info);
|
||||||
ht_cap_ie->data.capabilities_info & hapd->iconf->ht_capab;
|
cap &= hapd->iconf->ht_capab;
|
||||||
|
cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED);
|
||||||
neg_ht_cap_ie->data.capabilities_info &= ~HT_CAP_INFO_SMPS_DISABLED;
|
|
||||||
if ((ht_cap_ie->data.capabilities_info & HT_CAP_INFO_SMPS_DISABLED) ==
|
|
||||||
(hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED))
|
|
||||||
neg_ht_cap_ie->data.capabilities_info |=
|
|
||||||
hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED;
|
|
||||||
else
|
|
||||||
neg_ht_cap_ie->data.capabilities_info |=
|
|
||||||
HT_CAP_INFO_SMPS_DISABLED;
|
|
||||||
|
|
||||||
/* FIXME: Rx STBC needs to be handled specially */
|
/* FIXME: Rx STBC needs to be handled specially */
|
||||||
neg_ht_cap_ie->data.capabilities_info &= ~HT_CAP_INFO_RX_STBC_MASK;
|
cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK);
|
||||||
neg_ht_cap_ie->data.capabilities_info |=
|
neg_ht_cap_ie->data.capabilities_info = host_to_le16(cap);
|
||||||
hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_IEEE80211N */
|
#endif /* CONFIG_IEEE80211N */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user