diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-10 12:24:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-29 00:01:27 +0100 |
commit | 8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5 (patch) | |
tree | 9fc1c79ae579e20063d577912ad4aeb1aef3ba6d /include/net/ip_fib.h | |
parent | [IPV4]: Unify access to the routing tables. (diff) | |
download | linux-8ad4942cd5bdad4143f7aa1d1bd4f7b2526c19c5.tar.xz 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 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 249af662e897..dfb95d732aa5 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -165,7 +165,7 @@ struct fib_table { #define TABLE_LOCAL_INDEX 0 #define TABLE_MAIN_INDEX 1 -static inline struct fib_table *fib_get_table(u32 id) +static inline struct fib_table *fib_get_table(struct net *net, u32 id) { struct hlist_head *ptr; @@ -175,20 +175,20 @@ static inline struct fib_table *fib_get_table(u32 id) return hlist_entry(ptr->first, struct fib_table, tb_hlist); } -static inline struct fib_table *fib_new_table(u32 id) +static inline struct fib_table *fib_new_table(struct net *net, u32 id) { - return fib_get_table(id); + return fib_get_table(net, id); } static inline int fib_lookup(const struct flowi *flp, struct fib_result *res) { struct fib_table *table; - table = fib_get_table(RT_TABLE_LOCAL); + table = fib_get_table(&init_net, RT_TABLE_LOCAL); if (!table->tb_lookup(table, flp, res)) return 0; - table = fib_get_table(RT_TABLE_MAIN); + table = fib_get_table(&init_net, RT_TABLE_MAIN); if (!table->tb_lookup(table, flp, res)) return 0; return -ENETUNREACH; @@ -197,7 +197,7 @@ static inline int fib_lookup(const struct flowi *flp, struct fib_result *res) static inline void fib_select_default(const struct flowi *flp, struct fib_result *res) { - struct fib_table *table = fib_get_table(RT_TABLE_MAIN); + struct fib_table *table = fib_get_table(&init_net, RT_TABLE_MAIN); if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) table->tb_select_default(table, flp, res); } @@ -212,8 +212,8 @@ extern u32 fib_rules_tclass(struct fib_result *res); extern int fib_lookup(struct flowi *flp, struct fib_result *res); -extern struct fib_table *fib_new_table(u32 id); -extern struct fib_table *fib_get_table(u32 id); +extern struct fib_table *fib_new_table(struct net *net, u32 id); +extern struct fib_table *fib_get_table(struct net *net, u32 id); extern void fib_select_default(const struct flowi *flp, struct fib_result *res); #endif /* CONFIG_IP_MULTIPLE_TABLES */ |