diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-10 03:24:11 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:01:27 -0800 |
commit | 8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5 (patch) | |
tree | 9fc1c79ae579e20063d577912ad4aeb1aef3ba6d /net/ipv4/fib_rules.c | |
parent | 93456b6d7753def8760b423ac6b986eb9d5a4a95 (diff) | |
download | blackbird-op-linux-8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5.tar.gz blackbird-op-linux-8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5.zip |
[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>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r-- | net/ipv4/fib_rules.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 1aae61c8ea6a..49819fe7e4c3 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -93,7 +93,7 @@ static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp, goto errout; } - if ((tbl = fib_get_table(rule->table)) == NULL) + if ((tbl = fib_get_table(&init_net, rule->table)) == NULL) goto errout; err = tbl->tb_lookup(tbl, flp, (struct fib_result *) arg->result); @@ -109,7 +109,7 @@ void fib_select_default(const struct flowi *flp, struct fib_result *res) if (res->r && res->r->action == FR_ACT_TO_TBL && FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) { struct fib_table *tb; - if ((tb = fib_get_table(res->r->table)) != NULL) + if ((tb = fib_get_table(&init_net, res->r->table)) != NULL) tb->tb_select_default(tb, flp, res); } } @@ -130,13 +130,13 @@ static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) return 1; } -static struct fib_table *fib_empty_table(void) +static struct fib_table *fib_empty_table(struct net *net) { u32 id; for (id = 1; id <= RT_TABLE_MAX; id++) - if (fib_get_table(id) == NULL) - return fib_new_table(id); + if (fib_get_table(net, id) == NULL) + return fib_new_table(net, id); return NULL; } @@ -159,7 +159,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, if (rule->action == FR_ACT_TO_TBL) { struct fib_table *table; - table = fib_empty_table(); + table = fib_empty_table(&init_net); if (table == NULL) { err = -ENOBUFS; goto errout; |