Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111258
b: refs/heads/master
c: a627266
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 28, 2008
1 parent 196716d commit bc83180
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6be547a61d6220199826070cda792297c3d15994
refs/heads/master: a627266570605a98c5fda5b8234d9e92015e4d14
14 changes: 10 additions & 4 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
struct rtable *r = NULL;

for (st->bucket = rt_hash_mask; st->bucket >= 0; --st->bucket) {
if (!rt_hash_table[st->bucket].chain)
continue;
rcu_read_lock_bh();
r = rcu_dereference(rt_hash_table[st->bucket].chain);
while (r) {
Expand All @@ -299,11 +301,14 @@ static struct rtable *__rt_cache_get_next(struct seq_file *seq,
struct rtable *r)
{
struct rt_cache_iter_state *st = seq->private;

r = r->u.dst.rt_next;
while (!r) {
rcu_read_unlock_bh();
if (--st->bucket < 0)
break;
do {
if (--st->bucket < 0)
return NULL;
} while (!rt_hash_table[st->bucket].chain);
rcu_read_lock_bh();
r = rt_hash_table[st->bucket].chain;
}
Expand Down Expand Up @@ -2840,7 +2845,9 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (s_h < 0)
s_h = 0;
s_idx = idx = cb->args[1];
for (h = s_h; h <= rt_hash_mask; h++) {
for (h = s_h; h <= rt_hash_mask; h++, s_idx = 0) {
if (!rt_hash_table[h].chain)
continue;
rcu_read_lock_bh();
for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
Expand All @@ -2859,7 +2866,6 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
dst_release(xchg(&skb->dst, NULL));
}
rcu_read_unlock_bh();
s_idx = 0;
}

done:
Expand Down

0 comments on commit bc83180

Please sign in to comment.