Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29824310 authored by Harry Mason's avatar Harry Mason Committed by David S. Miller
Browse files

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: default avatarHarry Mason <harry.mason@smoothwall.net>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d36097d
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -219,11 +219,16 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,
	if (skb->priority == sch->handle)
	if (skb->priority == sch->handle)
		return HTB_DIRECT;	/* X:0 (direct flow) selected */
		return HTB_DIRECT;	/* X:0 (direct flow) selected */
	cl = htb_find(skb->priority, sch);
	cl = htb_find(skb->priority, sch);
	if (cl && cl->level == 0)
	if (cl) {
		if (cl->level == 0)
			return cl;
			return cl;
		/* Start with inner filter chain if a non-leaf class is selected */
		tcf = cl->filter_list;
	} else {
		tcf = q->filter_list;
	}


	*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
	*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
	tcf = q->filter_list;
	while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
	while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
#ifdef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NET_CLS_ACT
		switch (result) {
		switch (result) {