From 8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Thu, 10 Jan 2008 03:24:11 -0800 Subject: [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 Acked-by: Daniel Lezcano Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- net/ipv4/fib_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/ipv4/fib_hash.c') diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 694a072d809..d20ae2e28ab 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c @@ -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; } -- cgit v1.2.3