Commit 3e9e5a59 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller

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.
Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41065fba
...@@ -161,7 +161,7 @@ int register_qdisc(struct Qdisc_ops *qops) ...@@ -161,7 +161,7 @@ int register_qdisc(struct Qdisc_ops *qops)
if (qops->cl_ops) { if (qops->cl_ops) {
const struct Qdisc_class_ops *cops = 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; goto out_einval;
if (cops->tcf_chain && !(cops->bind_tcf && cops->unbind_tcf)) if (cops->tcf_chain && !(cops->bind_tcf && cops->unbind_tcf))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment