[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:

committed by
David S. Miller

parent
93456b6d77
commit
8ad4942cd5
@@ -2167,12 +2167,12 @@ static int fib_triestat_seq_show(struct seq_file *seq, void *v)
|
||||
struct fib_table *tb;
|
||||
|
||||
trie_local = NULL;
|
||||
tb = fib_get_table(RT_TABLE_LOCAL);
|
||||
tb = fib_get_table(&init_net, RT_TABLE_LOCAL);
|
||||
if (tb)
|
||||
trie_local = (struct trie *) tb->tb_data;
|
||||
|
||||
trie_main = NULL;
|
||||
tb = fib_get_table(RT_TABLE_MAIN);
|
||||
tb = fib_get_table(&init_net, RT_TABLE_MAIN);
|
||||
if (tb)
|
||||
trie_main = (struct trie *) tb->tb_data;
|
||||
|
||||
@@ -2239,12 +2239,12 @@ static void *fib_trie_seq_start(struct seq_file *seq, loff_t *pos)
|
||||
struct fib_table *tb;
|
||||
|
||||
if (!iter->trie_local) {
|
||||
tb = fib_get_table(RT_TABLE_LOCAL);
|
||||
tb = fib_get_table(&init_net, RT_TABLE_LOCAL);
|
||||
if (tb)
|
||||
iter->trie_local = (struct trie *) tb->tb_data;
|
||||
}
|
||||
if (!iter->trie_main) {
|
||||
tb = fib_get_table(RT_TABLE_MAIN);
|
||||
tb = fib_get_table(&init_net, RT_TABLE_MAIN);
|
||||
if (tb)
|
||||
iter->trie_main = (struct trie *) tb->tb_data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user