aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorHarry Mason <harry.mason@smoothwall.net>2014-01-17 08:22:32 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-22 20:39:48 -0500
commit29824310ce3e320726a45475a38fd0c3f0eaad60 (patch)
tree4c60d34ed4d40f7626c34ad7a935b544a4801d71 /net/sched
parent2d36097d26b5991d71a2cf4a20c1a158f0f1bfcd (diff)
sch_htb: let skb->priority refer to non-leaf class
If the class in skb->priority is not a leaf, apply filters from the selected class, not the qdisc. This lets netfilter or user space partially classify the packet. Signed-off-by: Harry Mason <harry.mason@smoothwall.net> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_htb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 0db5a6eae87f..722e137df244 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -219,11 +219,16 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,
219 if (skb->priority == sch->handle) 219 if (skb->priority == sch->handle)
220 return HTB_DIRECT; /* X:0 (direct flow) selected */ 220 return HTB_DIRECT; /* X:0 (direct flow) selected */
221 cl = htb_find(skb->priority, sch); 221 cl = htb_find(skb->priority, sch);
222 if (cl && cl->level == 0) 222 if (cl) {
223 return cl; 223 if (cl->level == 0)
224 return cl;
225 /* Start with inner filter chain if a non-leaf class is selected */
226 tcf = cl->filter_list;
227 } else {
228 tcf = q->filter_list;
229 }
224 230
225 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; 231 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
226 tcf = q->filter_list;
227 while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { 232 while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
228#ifdef CONFIG_NET_CLS_ACT 233#ifdef CONFIG_NET_CLS_ACT
229 switch (result) { 234 switch (result) {