Skip to content

Commit 8b142a0

Browse files
congwangdavem330
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]>
1 parent 94a72b3 commit 8b142a0

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
@@ -1920,6 +1920,8 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,
19201920
cl = cops->find(q, portid);
19211921
if (!cl)
19221922
return;
1923+
if (!cops->tcf_block)
1924+
return;
19231925
block = cops->tcf_block(q, cl, NULL);
19241926
if (!block)
19251927
return;

0 commit comments

Comments
 (0)