aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 455fadc3d84e..024519522d37 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -28,6 +28,7 @@ struct ieee80211_sched_data
28 struct sk_buff_head requeued[TC_80211_MAX_QUEUES]; 28 struct sk_buff_head requeued[TC_80211_MAX_QUEUES];
29}; 29};
30 30
31static const char llc_ip_hdr[8] = {0xAA, 0xAA, 0x3, 0, 0, 0, 0x08, 0};
31 32
32/* given a data frame determine the 802.1p/1d tag to use */ 33/* given a data frame determine the 802.1p/1d tag to use */
33static inline unsigned classify_1d(struct sk_buff *skb, struct Qdisc *qd) 34static inline unsigned classify_1d(struct sk_buff *skb, struct Qdisc *qd)
@@ -54,12 +55,12 @@ static inline unsigned classify_1d(struct sk_buff *skb, struct Qdisc *qd)
54 return skb->priority - 256; 55 return skb->priority - 256;
55 56
56 /* check there is a valid IP header present */ 57 /* check there is a valid IP header present */
57 offset = ieee80211_get_hdrlen_from_skb(skb) + 8 /* LLC + proto */; 58 offset = ieee80211_get_hdrlen_from_skb(skb);
58 if (skb->protocol != htons(ETH_P_IP) || 59 if (skb->len < offset + sizeof(llc_ip_hdr) + sizeof(*ip) ||
59 skb->len < offset + sizeof(*ip)) 60 memcmp(skb->data + offset, llc_ip_hdr, sizeof(llc_ip_hdr)))
60 return 0; 61 return 0;
61 62
62 ip = (struct iphdr *) (skb->data + offset); 63 ip = (struct iphdr *) (skb->data + offset + sizeof(llc_ip_hdr));
63 64
64 dscp = ip->tos & 0xfc; 65 dscp = ip->tos & 0xfc;
65 if (dscp & 0x1c) 66 if (dscp & 0x1c)