diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2008-03-04 02:27:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-04 02:27:06 -0500 |
commit | f3db48517f59133610f558f29de8834d7b007691 (patch) | |
tree | d4a69e551fb9f10ea64430a26e917ce1d77e39ff /net/ipv6/ip6_fib.c | |
parent | 58f09b78b730cf0d936597272bf35b3d615e967c (diff) |
[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>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r-- | net/ipv6/ip6_fib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 7b549f0bc428..0f9dc81f0e61 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1350,7 +1350,7 @@ static void fib6_clean_tree(struct fib6_node *root, | |||
1350 | fib6_walk(&c.w); | 1350 | fib6_walk(&c.w); |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | void fib6_clean_all(int (*func)(struct rt6_info *, void *arg), | 1353 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), |
1354 | int prune, void *arg) | 1354 | int prune, void *arg) |
1355 | { | 1355 | { |
1356 | struct fib6_table *table; | 1356 | struct fib6_table *table; |
@@ -1360,7 +1360,7 @@ void fib6_clean_all(int (*func)(struct rt6_info *, void *arg), | |||
1360 | 1360 | ||
1361 | rcu_read_lock(); | 1361 | rcu_read_lock(); |
1362 | for (h = 0; h < FIB_TABLE_HASHSZ; h++) { | 1362 | for (h = 0; h < FIB_TABLE_HASHSZ; h++) { |
1363 | head = &init_net.ipv6.fib_table_hash[h]; | 1363 | head = &net->ipv6.fib_table_hash[h]; |
1364 | hlist_for_each_entry_rcu(table, node, head, tb6_hlist) { | 1364 | hlist_for_each_entry_rcu(table, node, head, tb6_hlist) { |
1365 | write_lock_bh(&table->tb6_lock); | 1365 | write_lock_bh(&table->tb6_lock); |
1366 | fib6_clean_tree(&table->tb6_root, func, prune, arg); | 1366 | fib6_clean_tree(&table->tb6_root, func, prune, arg); |
@@ -1450,7 +1450,8 @@ void fib6_run_gc(unsigned long dummy) | |||
1450 | gc_args.more = 0; | 1450 | gc_args.more = 0; |
1451 | 1451 | ||
1452 | icmp6_dst_gc(&gc_args.more); | 1452 | icmp6_dst_gc(&gc_args.more); |
1453 | fib6_clean_all(fib6_age, 0, NULL); | 1453 | |
1454 | fib6_clean_all(&init_net, fib6_age, 0, NULL); | ||
1454 | 1455 | ||
1455 | if (gc_args.more) | 1456 | if (gc_args.more) |
1456 | mod_timer(&ip6_fib_timer, jiffies + | 1457 | mod_timer(&ip6_fib_timer, jiffies + |