Skip to content

Commit

Permalink
pkt_sched: Check .walk and .leaf class handlers
Browse files Browse the repository at this point in the history
Require qdisc class ops .walk and .leaf for classful qdisc in
register_qdisc(). The checks could be done later insted, but these
ops are really needed and used by most of classful qdiscs.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and davem330 committed Aug 11, 2010
1 parent 41065fb commit 3e9e5a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_api.c
Expand Up @@ -161,7 +161,7 @@ int register_qdisc(struct Qdisc_ops *qops)
if (qops->cl_ops) {
const struct Qdisc_class_ops *cops = qops->cl_ops;

if (!(cops->get && cops->put))
if (!(cops->get && cops->put && cops->walk && cops->leaf))
goto out_einval;

if (cops->tcf_chain && !(cops->bind_tcf && cops->unbind_tcf))
Expand Down

0 comments on commit 3e9e5a5

Please sign in to comment.