aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-11-16 11:58:08 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:34:22 (GMT)
commit6b18f2e013ba2fd3deb5a3454aca5279d6822ad2 (patch)
treea18b7376b39b9a1e7b5d26467fc209ae892bc240
parentf1a151f38c6a757117cbbb677fc88806507acd63 (diff)
downloadhostap-06-6b18f2e013ba2fd3deb5a3454aca5279d6822ad2.zip
hostap-06-6b18f2e013ba2fd3deb5a3454aca5279d6822ad2.tar.gz
hostap-06-6b18f2e013ba2fd3deb5a3454aca5279d6822ad2.tar.bz2
hostapd: Fix endian bugs in STA HT capability handling
(cherry picked from commit 9510f00ff896f2a407a30dd8420e3b5cef8d5128)
-rw-r--r--hostapd/ieee802_11.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/hostapd/ieee802_11.c b/hostapd/ieee802_11.c
index 9d9b8fb..70491b4 100644
--- a/hostapd/ieee802_11.c
+++ b/hostapd/ieee802_11.c
@@ -1563,24 +1563,16 @@ hostapd_get_ht_capab(struct hostapd_data *hapd,
struct ht_cap_ie *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));
- neg_ht_cap_ie->data.capabilities_info =
- ht_cap_ie->data.capabilities_info & hapd->iconf->ht_capab;
-
- 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;
+ cap = le_to_host16(neg_ht_cap_ie->data.capabilities_info);
+ cap &= hapd->iconf->ht_capab;
+ cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_SMPS_DISABLED);
/* FIXME: Rx STBC needs to be handled specially */
- neg_ht_cap_ie->data.capabilities_info &= ~HT_CAP_INFO_RX_STBC_MASK;
- neg_ht_cap_ie->data.capabilities_info |=
- hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK;
+ cap |= (hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK);
+ neg_ht_cap_ie->data.capabilities_info = host_to_le16(cap);
}
#endif /* CONFIG_IEEE80211N */