[NETNS][IPV6] ip6_fib - fib6_clean_all handle several network namespaces

The function fib6_clean_all takes the network namespace as
parameter. That allows to flush the routes related to a specific
network namespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Daniel Lezcano
2008-03-03 23:27:06 -08:00
committed by David S. Miller
parent 58f09b78b7
commit f3db48517f
5 changed files with 29 additions and 14 deletions

View File

@@ -1350,7 +1350,7 @@ static void fib6_clean_tree(struct fib6_node *root,
fib6_walk(&c.w);
}
void fib6_clean_all(int (*func)(struct rt6_info *, void *arg),
void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
int prune, void *arg)
{
struct fib6_table *table;
@@ -1360,7 +1360,7 @@ void fib6_clean_all(int (*func)(struct rt6_info *, void *arg),
rcu_read_lock();
for (h = 0; h < FIB_TABLE_HASHSZ; h++) {
head = &init_net.ipv6.fib_table_hash[h];
head = &net->ipv6.fib_table_hash[h];
hlist_for_each_entry_rcu(table, node, head, tb6_hlist) {
write_lock_bh(&table->tb6_lock);
fib6_clean_tree(&table->tb6_root, func, prune, arg);
@@ -1450,7 +1450,8 @@ void fib6_run_gc(unsigned long dummy)
gc_args.more = 0;
icmp6_dst_gc(&gc_args.more);
fib6_clean_all(fib6_age, 0, NULL);
fib6_clean_all(&init_net, fib6_age, 0, NULL);
if (gc_args.more)
mod_timer(&ip6_fib_timer, jiffies +