diff options
author | Lucas Nussbaum <lucas.nussbaum@imag.fr> | 2007-08-31 01:35:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-08-31 01:35:46 -0400 |
commit | dbaaa07a60edf71670b484a65e14400ab40c84f7 (patch) | |
tree | 2cc33dfd6509c6cac456ae0ccfe386333aaec70a | |
parent | b4a488d1824a2cc3514f9ee1298d805bd5edc893 (diff) |
[NET_SCHED] sch_prio.c: remove duplicate call of tc_classify()
When CONFIG_NET_CLS_ACT is enabled, tc_classify() is called twice in
prio_classify(). This causes "interesting" behaviour: with the setup
below, packets are duplicated, sent twice to ifb0, and then loop in and
out of ifb0.
The patch uses the previously calculated return value in the switch,
which is probably what Patrick had in mind in commit
bdba91ec70fb5ccbdeb1c7068319adc6ea9e1a7d -- maybe Patrick can
double-check this?
-- example setup --
ifconfig ifb0 up
tc qdisc add dev ifb0 root netem delay 2s
tc qdisc add dev $ETH root handle 1: prio
tc filter add dev $ETH parent 1: protocol ip prio 10 u32 \
match ip dst 172.24.110.6/32 flowid 1:1 \
action mirred egress redirect dev ifb0
ping -c1 172.24.110.6
Signed-off-by: Lucas Nussbaum <lucas.nussbaum@imag.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_prio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 4a49db65772e..abd82fc3ec60 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -44,7 +44,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) | |||
44 | if (TC_H_MAJ(skb->priority) != sch->handle) { | 44 | if (TC_H_MAJ(skb->priority) != sch->handle) { |
45 | err = tc_classify(skb, q->filter_list, &res); | 45 | err = tc_classify(skb, q->filter_list, &res); |
46 | #ifdef CONFIG_NET_CLS_ACT | 46 | #ifdef CONFIG_NET_CLS_ACT |
47 | switch (tc_classify(skb, q->filter_list, &res)) { | 47 | switch (err) { |
48 | case TC_ACT_STOLEN: | 48 | case TC_ACT_STOLEN: |
49 | case TC_ACT_QUEUED: | 49 | case TC_ACT_QUEUED: |
50 | *qerr = NET_XMIT_SUCCESS; | 50 | *qerr = NET_XMIT_SUCCESS; |