aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-21 20:31:55 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:19 -0500
commitda0e28cb68a7e22b47c6ae1a5b12cb538c13c69f (patch)
treeac5bc308d4532f7cd271ee58c9bba5decf9699bd /net
parentba93ef746560df597b19bbcee04ce7ed70ebc700 (diff)
[NETNS]: Add netns parameter to fib_lookup.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/fib_frontend.c4
-rw-r--r--net/ipv4/fib_rules.c4
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/route.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8987046d97f3..e056154076b3 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -241,7 +241,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
241 if (in_dev == NULL) 241 if (in_dev == NULL)
242 goto e_inval; 242 goto e_inval;
243 243
244 if (fib_lookup(&fl, &res)) 244 if (fib_lookup(&init_net, &fl, &res))
245 goto last_resort; 245 goto last_resort;
246 if (res.type != RTN_UNICAST) 246 if (res.type != RTN_UNICAST)
247 goto e_inval_res; 247 goto e_inval_res;
@@ -265,7 +265,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
265 fl.oif = dev->ifindex; 265 fl.oif = dev->ifindex;
266 266
267 ret = 0; 267 ret = 0;
268 if (fib_lookup(&fl, &res) == 0) { 268 if (fib_lookup(&init_net, &fl, &res) == 0) {
269 if (res.type == RTN_UNICAST) { 269 if (res.type == RTN_UNICAST) {
270 *spec_dst = FIB_RES_PREFSRC(res); 270 *spec_dst = FIB_RES_PREFSRC(res);
271 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST; 271 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index d2001f1c28a2..1effb4ab688c 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -54,14 +54,14 @@ u32 fib_rules_tclass(struct fib_result *res)
54} 54}
55#endif 55#endif
56 56
57int fib_lookup(struct flowi *flp, struct fib_result *res) 57int fib_lookup(struct net *net, struct flowi *flp, struct fib_result *res)
58{ 58{
59 struct fib_lookup_arg arg = { 59 struct fib_lookup_arg arg = {
60 .result = res, 60 .result = res,
61 }; 61 };
62 int err; 62 int err;
63 63
64 err = fib_rules_lookup(init_net.ipv4.rules_ops, flp, 0, &arg); 64 err = fib_rules_lookup(net->ipv4.rules_ops, flp, 0, &arg);
65 res->r = arg.rule; 65 res->r = arg.rule;
66 66
67 return err; 67 return err;
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 0e08df4d6f9a..ecd91c60975f 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -559,7 +559,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
559 /* It is not necessary, but requires a bit of thinking */ 559 /* It is not necessary, but requires a bit of thinking */
560 if (fl.fl4_scope < RT_SCOPE_LINK) 560 if (fl.fl4_scope < RT_SCOPE_LINK)
561 fl.fl4_scope = RT_SCOPE_LINK; 561 fl.fl4_scope = RT_SCOPE_LINK;
562 if ((err = fib_lookup(&fl, &res)) != 0) 562 if ((err = fib_lookup(&init_net, &fl, &res)) != 0)
563 return err; 563 return err;
564 } 564 }
565 err = -EINVAL; 565 err = -EINVAL;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f80c761ea0bb..a7651c64bb48 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1559,7 +1559,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
1559 1559
1560 if (rt->fl.iif == 0) 1560 if (rt->fl.iif == 0)
1561 src = rt->rt_src; 1561 src = rt->rt_src;
1562 else if (fib_lookup(&rt->fl, &res) == 0) { 1562 else if (fib_lookup(&init_net, &rt->fl, &res) == 0) {
1563 src = FIB_RES_PREFSRC(res); 1563 src = FIB_RES_PREFSRC(res);
1564 fib_res_put(&res); 1564 fib_res_put(&res);
1565 } else 1565 } else
@@ -1911,7 +1911,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1911 /* 1911 /*
1912 * Now we are ready to route packet. 1912 * Now we are ready to route packet.
1913 */ 1913 */
1914 if ((err = fib_lookup(&fl, &res)) != 0) { 1914 if ((err = fib_lookup(&init_net, &fl, &res)) != 0) {
1915 if (!IN_DEV_FORWARD(in_dev)) 1915 if (!IN_DEV_FORWARD(in_dev))
1916 goto e_hostunreach; 1916 goto e_hostunreach;
1917 goto no_route; 1917 goto no_route;
@@ -2363,7 +2363,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
2363 goto make_route; 2363 goto make_route;
2364 } 2364 }
2365 2365
2366 if (fib_lookup(&fl, &res)) { 2366 if (fib_lookup(&init_net, &fl, &res)) {
2367 res.fi = NULL; 2367 res.fi = NULL;
2368 if (oldflp->oif) { 2368 if (oldflp->oif) {
2369 /* Apparently, routing tables are wrong. Assume, 2369 /* Apparently, routing tables are wrong. Assume,