Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79321
b: refs/heads/master
c: 4c30719
h: refs/heads/master
i:
  79319: 90984c8
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 28, 2008
1 parent 876f9fa commit 5bfeffe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b0ac72bc5fdda9634fb07db4cb0237fa9b6df68
refs/heads/master: 4c30719f4f550d9b3034d9c00da9cb7fb99e6c0b
19 changes: 15 additions & 4 deletions trunk/net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,19 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch)
pr_debug("dsmark_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);

if (p->set_tc_index) {
/* FIXME: Safe with non-linear skbs? --RR */
switch (skb->protocol) {
case __constant_htons(ETH_P_IP):
if (skb_cow_head(skb, sizeof(struct iphdr)))
goto drop;

skb->tc_index = ipv4_get_dsfield(ip_hdr(skb))
& ~INET_ECN_MASK;
break;

case __constant_htons(ETH_P_IPV6):
if (skb_cow_head(skb, sizeof(struct ipv6hdr)))
goto drop;

skb->tc_index = ipv6_get_dsfield(ipv6_hdr(skb))
& ~INET_ECN_MASK;
break;
Expand All @@ -217,14 +223,14 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch)
case TC_ACT_STOLEN:
kfree_skb(skb);
return NET_XMIT_SUCCESS;

case TC_ACT_SHOT:
kfree_skb(skb);
sch->qstats.drops++;
return NET_XMIT_BYPASS;
goto drop;
#endif
case TC_ACT_OK:
skb->tc_index = TC_H_MIN(res.classid);
break;

default:
if (p->default_index != NO_DEFAULT_INDEX)
skb->tc_index = p->default_index;
Expand All @@ -243,6 +249,11 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch)
sch->q.qlen++;

return NET_XMIT_SUCCESS;

drop:
kfree_skb(skb);
sch->qstats.drops++;
return NET_XMIT_BYPASS;
}

static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
Expand Down

0 comments on commit 5bfeffe

Please sign in to comment.