# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/08/04 21:51:04+02:00 kaber@coreworks.de # [PKT_SCHED]: Fix q_idx calculation in tc_dump_qdisc # # Signed-off-by: Patrick McHardy # # net/sched/sch_api.c # 2004/08/04 21:50:44+02:00 kaber@coreworks.de +5 -2 # [PKT_SCHED]: Fix q_idx calculation in tc_dump_qdisc # diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2004-08-04 21:55:13 +02:00 +++ b/net/sched/sch_api.c 2004-08-04 21:55:13 +02:00 @@ -817,13 +817,16 @@ 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 @@ read_unlock(&dev_base_lock); cb->args[0] = idx; - cb->args[1] = q_idx - 1; + cb->args[1] = q_idx; return skb->len; }