Thread (13 messages) 13 messages, 3 authors, 2007-01-31

Re: [PATCH][NET_SCHED] sch_prio: class statistics printing enabled

From: Jarek Poplawski <hidden>
Date: 2007-01-31 14:58:21

On Wed, Jan 31, 2007 at 03:37:25PM +0100, Patrick McHardy wrote:
Jarek Poplawski wrote:
quoted
+static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
+				 struct gnet_dump *d)
+{
+	struct prio_sched_data *q = qdisc_priv(sch);
+	struct Qdisc *cl_q;
+
+	if (cl - 1 > q->bands)
+		return -1;
Thats not what I meant, it still hides the bug. Either do
nothing (don't check) or do BUG_ON(cl - 1 > q->bands).
Sorry - problems with reading!

And with understanding...
From sch_api.c:
       if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0)
               goto rtattr_failure;

       if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
                       TCA_XSTATS, q->stats_lock, &d) < 0)
               goto rtattr_failure;

       if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0)
               goto rtattr_failure;
I can't see any difference between calling ->dump and
->dump_stats? Of course we may forsee this error should
jump over cl_ops...

But I'm polite still, so in a minute...

Jarek P.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help