summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorDavid S. Miller2008-01-25 01:57:39 +0100
committerDavid S. Miller2008-01-28 23:53:30 +0100
commitd10f2150eab62f633aeae36cf4612d1f648a817e (patch)
tree5cc1447e8a17bf13d1f6be6aa8bbec19a3c9f9d9 /net/mac80211
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog (diff)
downloadkernel-qcow2-linux-d10f2150eab62f633aeae36cf4612d1f648a817e.tar.gz
kernel-qcow2-linux-d10f2150eab62f633aeae36cf4612d1f648a817e.tar.xz
kernel-qcow2-linux-d10f2150eab62f633aeae36cf4612d1f648a817e.zip
[MAC80211]: Revert unaligned warning removal.
For release Linux removed this warning, but we want it back for development. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 00f908d9275e..a7263fc476bd 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1443,6 +1443,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_sub_if_data *prev = NULL;
struct sk_buff *skb_new;
u8 *bssid;
+ int hdrlen;
/*
* key references and virtual interfaces are protected using RCU
@@ -1472,6 +1473,18 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
rx.fc = le16_to_cpu(hdr->frame_control);
type = rx.fc & IEEE80211_FCTL_FTYPE;
+ /*
+ * Drivers are required to align the payload data to a four-byte
+ * boundary, so the last two bits of the address where it starts
+ * may not be set. The header is required to be directly before
+ * the payload data, padding like atheros hardware adds which is
+ * inbetween the 802.11 header and the payload is not supported,
+ * the driver is required to move the 802.11 header further back
+ * in that case.
+ */
+ hdrlen = ieee80211_get_hdrlen(rx.fc);
+ WARN_ON_ONCE(((unsigned long)(skb->data + hdrlen)) & 3);
+
if (type == IEEE80211_FTYPE_DATA || type == IEEE80211_FTYPE_MGMT)
local->dot11ReceivedFragmentCount++;