diff options
author | Jiri Pirko <jiri@resnulli.us> | 2015-01-13 11:13:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-13 17:51:08 -0500 |
commit | d8b9605d2697c48fb822c821c5751afbb4567003 (patch) | |
tree | e9c4cbcafae686743acae5cd834086735e31aa7a /net/sched/sch_dsmark.c | |
parent | 8bdda5ddd1f1590ae24002749adb72693b80baaf (diff) |
net: sched: fix skb->protocol use in case of accelerated vlan path
tc code implicitly considers skb->protocol even in case of accelerated
vlan paths and expects vlan protocol type here. However, on rx path,
if the vlan header was already stripped, skb->protocol contains value
of next header. Similar situation is on tx path.
So for skbs that use skb->vlan_tci for tagging, use skb->vlan_proto instead.
Reported-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_dsmark.c')
-rw-r--r-- | net/sched/sch_dsmark.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 227114f27f94..66700a6116aa 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
@@ -203,7 +203,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
203 | pr_debug("%s(skb %p,sch %p,[qdisc %p])\n", __func__, skb, sch, p); | 203 | pr_debug("%s(skb %p,sch %p,[qdisc %p])\n", __func__, skb, sch, p); |
204 | 204 | ||
205 | if (p->set_tc_index) { | 205 | if (p->set_tc_index) { |
206 | switch (skb->protocol) { | 206 | switch (tc_skb_protocol(skb)) { |
207 | case htons(ETH_P_IP): | 207 | case htons(ETH_P_IP): |
208 | if (skb_cow_head(skb, sizeof(struct iphdr))) | 208 | if (skb_cow_head(skb, sizeof(struct iphdr))) |
209 | goto drop; | 209 | goto drop; |
@@ -289,7 +289,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | |||
289 | index = skb->tc_index & (p->indices - 1); | 289 | index = skb->tc_index & (p->indices - 1); |
290 | pr_debug("index %d->%d\n", skb->tc_index, index); | 290 | pr_debug("index %d->%d\n", skb->tc_index, index); |
291 | 291 | ||
292 | switch (skb->protocol) { | 292 | switch (tc_skb_protocol(skb)) { |
293 | case htons(ETH_P_IP): | 293 | case htons(ETH_P_IP): |
294 | ipv4_change_dsfield(ip_hdr(skb), p->mask[index], | 294 | ipv4_change_dsfield(ip_hdr(skb), p->mask[index], |
295 | p->value[index]); | 295 | p->value[index]); |
@@ -306,7 +306,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | |||
306 | */ | 306 | */ |
307 | if (p->mask[index] != 0xff || p->value[index]) | 307 | if (p->mask[index] != 0xff || p->value[index]) |
308 | pr_warn("%s: unsupported protocol %d\n", | 308 | pr_warn("%s: unsupported protocol %d\n", |
309 | __func__, ntohs(skb->protocol)); | 309 | __func__, ntohs(tc_skb_protocol(skb))); |
310 | break; | 310 | break; |
311 | } | 311 | } |
312 | 312 | ||