diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-11-12 14:15:13 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-11-12 14:15:13 +0000 |
commit | 6689068b3486b6f42e5cfc54beceee5c399a18da (patch) | |
tree | df73cc74e14deba72a3d4c89f0cc9a531ff332a5 /package/hostapd/patches/150-ht_cap_endian.patch | |
parent | 0cd687487e6b10daba6017c9296d52f48ddbe1c1 (diff) | |
download | upstream-6689068b3486b6f42e5cfc54beceee5c399a18da.tar.gz upstream-6689068b3486b6f42e5cfc54beceee5c399a18da.tar.bz2 upstream-6689068b3486b6f42e5cfc54beceee5c399a18da.zip |
hostapd: fix endian bugs in STA HT capability handling
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18405 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/hostapd/patches/150-ht_cap_endian.patch')
-rw-r--r-- | package/hostapd/patches/150-ht_cap_endian.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/package/hostapd/patches/150-ht_cap_endian.patch b/package/hostapd/patches/150-ht_cap_endian.patch new file mode 100644 index 0000000000..d8f3856eed --- /dev/null +++ b/package/hostapd/patches/150-ht_cap_endian.patch @@ -0,0 +1,33 @@ +--- a/hostapd/ieee802_11.c ++++ b/hostapd/ieee802_11.c +@@ -1586,24 +1586,16 @@ hostapd_get_ht_capab(struct hostapd_data + 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 */ + |