Skip to contentSkip to conversation

pkt_sched: Check .walk and .leaf class handlers

PATCH In review Jarek Poplawski 1 participant 1 message Aug 11, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 pkt_sched: Check .walk and .leaf class handlers

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.

---

net/sched/sch_api.c +1 -1
index 8ed2f56..408eea7 100644
@@ -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))