aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_sfq.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-09-04 02:41:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-06 05:07:02 -0400
commitde6d5cdf881353f83006d5f3e28ac4fffd42145e (patch)
treeedc032e4d0a868578780facdd28fb0ee277aadc3 /net/sched/sch_sfq.c
parent71ebe5e91947392bc276af713827eab12b6db8e4 (diff)
net_sched: make cls_ops->change and cls_ops->delete optional
Some schedulers don't support creating, changing or deleting classes. Make the respective callbacks optionally and consistently return -EOPNOTSUPP for unsupported operations, instead of currently either -EOPNOTSUPP, -ENOSYS or no error. In case of sch_prio and sch_multiq, the removed operations additionally checked for an invalid class. This is not necessary since the class argument can only orginate from ->get() or in case of ->change is 0 for creation of new classes, in which case ->change() incorrectly returned -ENOENT. As a side-effect, this patch fixes a possible (root-only) NULL pointer function call in sch_ingress, which didn't implement a so far mandatory ->delete() operation. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r--net/sched/sch_sfq.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 8706920a6d45..cb21380c0605 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -496,12 +496,6 @@ nla_put_failure:
496 return -1; 496 return -1;
497} 497}
498 498
499static int sfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
500 struct nlattr **tca, unsigned long *arg)
501{
502 return -EOPNOTSUPP;
503}
504
505static unsigned long sfq_get(struct Qdisc *sch, u32 classid) 499static unsigned long sfq_get(struct Qdisc *sch, u32 classid)
506{ 500{
507 return 0; 501 return 0;
@@ -560,7 +554,6 @@ static void sfq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
560 554
561static const struct Qdisc_class_ops sfq_class_ops = { 555static const struct Qdisc_class_ops sfq_class_ops = {
562 .get = sfq_get, 556 .get = sfq_get,
563 .change = sfq_change_class,
564 .tcf_chain = sfq_find_tcf, 557 .tcf_chain = sfq_find_tcf,
565 .dump = sfq_dump_class, 558 .dump = sfq_dump_class,
566 .dump_stats = sfq_dump_class_stats, 559 .dump_stats = sfq_dump_class_stats,