Search Linux Wireless

Re: Strange mac80211 oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This might help. Totally untested.

---
 drivers/net/wireless/zd1211rw/zd_mac.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- everything.orig/drivers/net/wireless/zd1211rw/zd_mac.c	2007-12-29 14:42:18.292833767 +0100
+++ everything/drivers/net/wireless/zd1211rw/zd_mac.c	2007-12-29 14:47:34.022831923 +0100
@@ -612,6 +612,8 @@ int zd_mac_rx(struct ieee80211_hw *hw, c
 	int bad_frame = 0;
 	int i;
 	u8 rate;
+	u16 fc;
+	int is_qos, is_4addr;
 
 	if (length < ZD_PLCP_HEADER_SIZE + 10 /* IEEE80211_1ADDR_LEN */ +
 	             FCS_LEN + sizeof(struct rx_status))
@@ -671,6 +673,16 @@ int zd_mac_rx(struct ieee80211_hw *hw, c
 	skb = dev_alloc_skb(length);
 	if (skb == NULL)
 		return -ENOMEM;
+
+	fc = le16_to_cpu(*((__le16 *) buffer));
+
+	is_qos = !!(fc & IEEE80211_STYPE_QOS_DATA);
+	is_4addr = (fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) ==
+			(IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS);
+
+	if (is_qos ^ is_4addr)
+		skb_reserve(skb, 2);
+
 	memcpy(skb_put(skb, length), buffer, length);
 
 	ieee80211_rx_irqsafe(hw, skb, &stats);


-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux