diff options
author | Patrick McHardy <kaber@trash.net> | 2004-08-03 23:31:56 -0700 |
---|---|---|
committer | David S. Miller <davem@nuts.davemloft.net> | 2004-08-03 23:31:56 -0700 |
commit | 33f5782fd4a67c9bcb9a7ec95f945078d302a822 (patch) | |
tree | 34d00dfe82ba9c6e8fd8daa2171058e0b54e4ee3 /net | |
parent | 251f4c317c0d60922313476cabf37d755c88244d (diff) | |
download | history-33f5782fd4a67c9bcb9a7ec95f945078d302a822.tar.gz |
[PKT_SCHED]: Fix q_idx calculation in tc_dump_qdisc.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_api.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index a69089d442d43a..1f9bf9d0834cf0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -817,13 +817,16 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) read_lock_bh(&qdisc_tree_lock); q_idx = 0; list_for_each_entry(q, &dev->qdisc_list, list) { - if (q_idx++ < s_q_idx) + if (q_idx < s_q_idx) { + q_idx++; continue; + } if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) { read_unlock_bh(&qdisc_tree_lock); goto done; } + q_idx++; } read_unlock_bh(&qdisc_tree_lock); } @@ -832,7 +835,7 @@ done: read_unlock(&dev_base_lock); cb->args[0] = idx; - cb->args[1] = q_idx - 1; + cb->args[1] = q_idx; return skb->len; } |