Skip to content

Commit afbc7db

Browse files
congwangSomasundaram Krishnasamy
authored andcommitted
net_sched: check cops->tcf_block in tc_bind_tclass()
At least sch_red and sch_tbf don't implement ->tcf_block() while still have a non-zero tc "class". Instead of adding nop implementations to each of such qdisc's, we can just relax the check of cops->tcf_block() in tc_bind_tclass(). They don't support TC filter anyway. Reported-by: [email protected] Cc: Jamal Hadi Salim <[email protected]> Cc: Jiri Pirko <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 8b142a0) Orabug: 30448284 Signed-off-by: George Kennedy <[email protected]> Reviewed-by: Liam Merwick <[email protected]> Conflicts: net/sched/sch_api.c Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent c867ad9 commit afbc7db

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/sched/sch_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,8 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,
16951695
cl = cops->find(q, portid);
16961696
if (!cl)
16971697
return;
1698+
if (!cops->tcf_block)
1699+
return;
16981700
block = cops->tcf_block(q, cl);
16991701
if (!block)
17001702
return;

0 commit comments

Comments
 (0)