[NETNS]: Add netns parameter to fib_get_table/fib_new_table.

This patch extends the fib_get_table and the fib_new_table functions
with the network namespace pointer. That will allow to access the
table relatively from the network namespace.

Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Denis V. Lunev
2008-01-10 03:24:11 -08:00
committed by David S. Miller
parent 93456b6d77
commit 8ad4942cd5
5 changed files with 32 additions and 32 deletions

View File

@ -796,7 +796,7 @@ struct fib_iter_state {
static struct fib_alias *fib_get_first(struct seq_file *seq)
{
struct fib_iter_state *iter = seq->private;
struct fib_table *main_table = fib_get_table(RT_TABLE_MAIN);
struct fib_table *main_table = fib_get_table(&init_net, RT_TABLE_MAIN);
struct fn_hash *table = (struct fn_hash *)main_table->tb_data;
iter->bucket = 0;
@ -937,7 +937,7 @@ static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
void *v = NULL;
read_lock(&fib_hash_lock);
if (fib_get_table(RT_TABLE_MAIN))
if (fib_get_table(&init_net, RT_TABLE_MAIN))
v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
return v;
}