aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-23 01:06:48 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:11:05 -0500
commit611c183ebcb5af384df3a4ddb391034a1b6ac255 (patch)
tree368ec261285af31fcf5a4f61651f01017e6d2692
parentb40afd0e5c568aba79a4ae2a963cd2af1f09490d (diff)
[NETNS]: Add namespace parameter to __ip_route_output_key.
This is only required to propagate it down to the ip_route_output_slow. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/route.h4
-rw-r--r--net/ipv4/icmp.c4
-rw-r--r--net/ipv4/route.c7
-rw-r--r--net/ipv4/xfrm4_policy.c2
4 files changed, 9 insertions, 8 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 5847e6fabe8e..3e3b14e060f9 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -110,7 +110,7 @@ extern int ip_rt_init(void);
110extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, 110extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
111 __be32 src, struct net_device *dev); 111 __be32 src, struct net_device *dev);
112extern void rt_cache_flush(int how); 112extern void rt_cache_flush(int how);
113extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); 113extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
114extern int ip_route_output_key(struct rtable **, struct flowi *flp); 114extern int ip_route_output_key(struct rtable **, struct flowi *flp);
115extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 115extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
116extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); 116extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
@@ -158,7 +158,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
158 158
159 int err; 159 int err;
160 if (!dst || !src) { 160 if (!dst || !src) {
161 err = __ip_route_output_key(rp, &fl); 161 err = __ip_route_output_key(&init_net, rp, &fl);
162 if (err) 162 if (err)
163 return err; 163 return err;
164 fl.fl4_dst = (*rp)->rt_dst; 164 fl.fl4_dst = (*rp)->rt_dst;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 37cdea0c26b4..11760310f917 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -569,7 +569,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
569 struct rtable *rt2; 569 struct rtable *rt2;
570 570
571 security_skb_classify_flow(skb_in, &fl); 571 security_skb_classify_flow(skb_in, &fl);
572 if (__ip_route_output_key(&rt, &fl)) 572 if (__ip_route_output_key(&init_net, &rt, &fl))
573 goto out_unlock; 573 goto out_unlock;
574 574
575 /* No need to clone since we're just using its address. */ 575 /* No need to clone since we're just using its address. */
@@ -592,7 +592,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
592 goto out_unlock; 592 goto out_unlock;
593 593
594 if (inet_addr_type(&init_net, fl.fl4_src) == RTN_LOCAL) 594 if (inet_addr_type(&init_net, fl.fl4_src) == RTN_LOCAL)
595 err = __ip_route_output_key(&rt2, &fl); 595 err = __ip_route_output_key(&init_net, &rt2, &fl);
596 else { 596 else {
597 struct flowi fl2 = {}; 597 struct flowi fl2 = {};
598 struct dst_entry *odst; 598 struct dst_entry *odst;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0576ff79c550..971ab0253a09 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2443,7 +2443,8 @@ make_route:
2443out: return err; 2443out: return err;
2444} 2444}
2445 2445
2446int __ip_route_output_key(struct rtable **rp, const struct flowi *flp) 2446int __ip_route_output_key(struct net *net, struct rtable **rp,
2447 const struct flowi *flp)
2447{ 2448{
2448 unsigned hash; 2449 unsigned hash;
2449 struct rtable *rth; 2450 struct rtable *rth;
@@ -2470,7 +2471,7 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp)
2470 } 2471 }
2471 rcu_read_unlock_bh(); 2472 rcu_read_unlock_bh();
2472 2473
2473 return ip_route_output_slow(&init_net, rp, flp); 2474 return ip_route_output_slow(net, rp, flp);
2474} 2475}
2475 2476
2476EXPORT_SYMBOL_GPL(__ip_route_output_key); 2477EXPORT_SYMBOL_GPL(__ip_route_output_key);
@@ -2536,7 +2537,7 @@ int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk,
2536{ 2537{
2537 int err; 2538 int err;
2538 2539
2539 if ((err = __ip_route_output_key(rp, flp)) != 0) 2540 if ((err = __ip_route_output_key(&init_net, rp, flp)) != 0)
2540 return err; 2541 return err;
2541 2542
2542 if (flp->proto) { 2543 if (flp->proto) {
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index f04516c880fb..3783e3ee56a4 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -36,7 +36,7 @@ static struct dst_entry *xfrm4_dst_lookup(int tos, xfrm_address_t *saddr,
36 if (saddr) 36 if (saddr)
37 fl.fl4_src = saddr->a4; 37 fl.fl4_src = saddr->a4;
38 38
39 err = __ip_route_output_key(&rt, &fl); 39 err = __ip_route_output_key(&init_net, &rt, &fl);
40 dst = &rt->u.dst; 40 dst = &rt->u.dst;
41 if (err) 41 if (err)
42 dst = ERR_PTR(err); 42 dst = ERR_PTR(err);