Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184006
b: refs/heads/master
c: 2bec5a3
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 12, 2010
1 parent 68bb902 commit 68e63d4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 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: 69a6a0b38a139ccceef32222108caca8a9b0b795
refs/heads/master: 2bec5a369ee79576a3eea2c23863325089785a2c
2 changes: 2 additions & 0 deletions trunk/include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ struct fib6_walker_t {
struct rt6_info *leaf;
unsigned char state;
unsigned char prune;
unsigned int skip;
unsigned int count;
int (*func)(struct fib6_walker_t *);
void *args;
};
Expand Down
29 changes: 27 additions & 2 deletions trunk/net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,26 @@ static int fib6_dump_table(struct fib6_table *table, struct sk_buff *skb,
w->root = &table->tb6_root;

if (cb->args[4] == 0) {
w->count = 0;
w->skip = 0;

read_lock_bh(&table->tb6_lock);
res = fib6_walk(w);
read_unlock_bh(&table->tb6_lock);
if (res > 0)
if (res > 0) {
cb->args[4] = 1;
cb->args[5] = w->root->fn_sernum;
}
} else {
if (cb->args[5] != w->root->fn_sernum) {
/* Begin at the root if the tree changed */
cb->args[5] = w->root->fn_sernum;
w->state = FWS_INIT;
w->node = w->root;
w->skip = w->count;
} else
w->skip = 0;

read_lock_bh(&table->tb6_lock);
res = fib6_walk_continue(w);
read_unlock_bh(&table->tb6_lock);
Expand Down Expand Up @@ -1250,9 +1264,18 @@ static int fib6_walk_continue(struct fib6_walker_t *w)
w->leaf = fn->leaf;
case FWS_C:
if (w->leaf && fn->fn_flags&RTN_RTINFO) {
int err = w->func(w);
int err;

if (w->count < w->skip) {
w->count++;
continue;
}

err = w->func(w);
if (err)
return err;

w->count++;
continue;
}
w->state = FWS_U;
Expand Down Expand Up @@ -1346,6 +1369,8 @@ static void fib6_clean_tree(struct net *net, struct fib6_node *root,
c.w.root = root;
c.w.func = fib6_clean_node;
c.w.prune = prune;
c.w.count = 0;
c.w.skip = 0;
c.func = func;
c.arg = arg;
c.net = net;
Expand Down

0 comments on commit 68e63d4

Please sign in to comment.