[NETNS]: Add netns parameter to fib_lookup.
authorDenis V. Lunev <den@openvz.org>
Tue, 22 Jan 2008 01:31:55 +0000 (17:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:10:19 +0000 (15:10 -0800)
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_frontend.c
net/ipv4/fib_rules.c
net/ipv4/fib_semantics.c
net/ipv4/route.c

index f580542..a859124 100644 (file)
@@ -178,15 +178,16 @@ static inline struct fib_table *fib_new_table(struct net *net, u32 id)
        return fib_get_table(net, id);
 }
 
-static inline int fib_lookup(const struct flowi *flp, struct fib_result *res)
+static inline int fib_lookup(struct net *net, const struct flowi *flp,
+                            struct fib_result *res)
 {
        struct fib_table *table;
 
-       table = fib_get_table(&init_net, RT_TABLE_LOCAL);
+       table = fib_get_table(net, RT_TABLE_LOCAL);
        if (!table->tb_lookup(table, flp, res))
                return 0;
 
-       table = fib_get_table(&init_net, RT_TABLE_MAIN);
+       table = fib_get_table(net, RT_TABLE_MAIN);
        if (!table->tb_lookup(table, flp, res))
                return 0;
        return -ENETUNREACH;
@@ -208,7 +209,7 @@ extern void __net_exit fib4_rules_exit(struct net *net);
 extern u32 fib_rules_tclass(struct fib_result *res);
 #endif
 
-extern int fib_lookup(struct flowi *flp, struct fib_result *res);
+extern int fib_lookup(struct net *n, struct flowi *flp, struct fib_result *res);
 
 extern struct fib_table *fib_new_table(struct net *net, u32 id);
 extern struct fib_table *fib_get_table(struct net *net, u32 id);
index 8987046..e056154 100644 (file)
@@ -241,7 +241,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
        if (in_dev == NULL)
                goto e_inval;
 
-       if (fib_lookup(&fl, &res))
+       if (fib_lookup(&init_net, &fl, &res))
                goto last_resort;
        if (res.type != RTN_UNICAST)
                goto e_inval_res;
@@ -265,7 +265,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
        fl.oif = dev->ifindex;
 
        ret = 0;
-       if (fib_lookup(&fl, &res) == 0) {
+       if (fib_lookup(&init_net, &fl, &res) == 0) {
                if (res.type == RTN_UNICAST) {
                        *spec_dst = FIB_RES_PREFSRC(res);
                        ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
Simple merge
Simple merge
Simple merge