Commit dbaaa07a authored by Lucas Nussbaum's avatar Lucas Nussbaum Committed by David S. Miller
Browse files

[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

 -- 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 flowid 1:1 \
 action mirred egress redirect dev ifb0
ping -c1
Signed-off-by: default avatarLucas Nussbaum <>
Signed-off-by: default avatarDavid S. Miller <>
parent b4a488d1
......@@ -44,7 +44,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
if (TC_H_MAJ(skb->priority) != sch->handle) {
err = tc_classify(skb, q->filter_list, &res);
switch (tc_classify(skb, q->filter_list, &res)) {
switch (err) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment