public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] pkt_sched: Check .walk and .leaf class handlers
@ 2010-08-11  8:31 Jarek Poplawski
  0 siblings, 0 replies; only message in thread
From: Jarek Poplawski @ 2010-08-11  8:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Stephen Hemminger, Patrick McHardy, Franchoze Eric

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>
---

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-11  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11  8:31 [PATCH 2/2] pkt_sched: Check .walk and .leaf class handlers Jarek Poplawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox