summaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-06-15 14:34:54 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-06-15 14:34:54 +0000
commit5fe6515b5ff80c08d2cdaf972e7f9bf4497952a5 (patch)
treed3b5a81b6406ddb0791446a0c394b013fdba237d /package/mac80211/patches
parent7db6197f88bbd91afb6a80994f378e759d11f94b (diff)
[package] fix unaligned accesses in b43/xmit.c (#5169)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16474 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches')
-rw-r--r--package/mac80211/patches/541-b43_unaligned_access.pach52
1 files changed, 52 insertions, 0 deletions
diff --git a/package/mac80211/patches/541-b43_unaligned_access.pach b/package/mac80211/patches/541-b43_unaligned_access.pach
new file mode 100644
index 000000000..36e22d82e
--- /dev/null
+++ b/package/mac80211/patches/541-b43_unaligned_access.pach
@@ -0,0 +1,52 @@
+From: Matthieu CASTET <castet.matthieu@free.fr>
+
+Fix possible unaligned u32 access in b43_generate_plcp_hdr().
+Unaligned data is read/write with a u32 pointer instead of using the
+packed structure. Some versions of gcc ignore the "packed" attribute, if the
+structure element is accessed through a local pointer.
+
+Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
+Signed-off-by: Michael Buesch <mb@bu3sch.de>
+
+---
+
+Please queue this bugfix.
+
+
+diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
+index a63d888..55f36a7 100644
+--- a/drivers/net/wireless/b43/xmit.c
++++ b/drivers/net/wireless/b43/xmit.c
+@@ -118,7 +118,6 @@ u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate)
+ void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp,
+ const u16 octets, const u8 bitrate)
+ {
+- __le32 *data = &(plcp->data);
+ __u8 *raw = plcp->raw;
+
+ if (b43_is_ofdm_rate(bitrate)) {
+@@ -127,7 +126,7 @@ void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp,
+ d = b43_plcp_get_ratecode_ofdm(bitrate);
+ B43_WARN_ON(octets & 0xF000);
+ d |= (octets << 5);
+- *data = cpu_to_le32(d);
++ plcp->data = cpu_to_le32(d);
+ } else {
+ u32 plen;
+
+@@ -141,7 +140,7 @@ void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp,
+ raw[1] = 0x04;
+ } else
+ raw[1] = 0x04;
+- *data |= cpu_to_le32(plen << 16);
++ plcp->data |= cpu_to_le32(plen << 16);
+ raw[0] = b43_plcp_get_ratecode_cck(bitrate);
+ }
+ }
+
+--
+Greetings, Michael.
+--
+To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file