aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-23 01:07:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:11:07 -0500
commitf206351a50ea86250fabea96b9af8d8f8fc02603 (patch)
tree014148d8b45db1995d98374ec3b30e635f243197
parentf1b050bf7a88910f9f00c9c8989c1bf5a67dd140 (diff)
[NETNS]: Add namespace parameter to ip_route_output_key.
Needed to propagate it down to the ip_route_output_flow. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/infiniband/core/addr.c4
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--include/net/route.h2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/bridge/br_netfilter.c2
-rw-r--r--net/ipv4/arp.c6
-rw-r--r--net/ipv4/icmp.c4
-rw-r--r--net/ipv4/igmp.c6
-rw-r--r--net/ipv4/ip_gre.c10
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/ipip.c8
-rw-r--r--net/ipv4/ipmr.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c6
-rw-r--r--net/ipv4/netfilter.c6
-rw-r--r--net/ipv4/netfilter/nf_nat_rule.c2
-rw-r--r--net/ipv4/route.c6
-rw-r--r--net/ipv4/syncookies.c2
-rw-r--r--net/ipv6/ip6_tunnel.c4
-rw-r--r--net/ipv6/sit.c4
-rw-r--r--net/rxrpc/ar-peer.c2
-rw-r--r--net/sctp/protocol.c4
21 files changed, 44 insertions, 44 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 963177e1c9de..a58ad8a470f9 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -158,7 +158,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
158 158
159 memset(&fl, 0, sizeof fl); 159 memset(&fl, 0, sizeof fl);
160 fl.nl_u.ip4_u.daddr = dst_ip; 160 fl.nl_u.ip4_u.daddr = dst_ip;
161 if (ip_route_output_key(&rt, &fl)) 161 if (ip_route_output_key(&init_net, &rt, &fl))
162 return; 162 return;
163 163
164 neigh_event_send(rt->u.dst.neighbour, NULL); 164 neigh_event_send(rt->u.dst.neighbour, NULL);
@@ -179,7 +179,7 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
179 memset(&fl, 0, sizeof fl); 179 memset(&fl, 0, sizeof fl);
180 fl.nl_u.ip4_u.daddr = dst_ip; 180 fl.nl_u.ip4_u.daddr = dst_ip;
181 fl.nl_u.ip4_u.saddr = src_ip; 181 fl.nl_u.ip4_u.saddr = src_ip;
182 ret = ip_route_output_key(&rt, &fl); 182 ret = ip_route_output_key(&init_net, &rt, &fl);
183 if (ret) 183 if (ret)
184 goto out; 184 goto out;
185 185
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 49a198206e3d..2039f7838f2d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2517,7 +2517,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2517 fl.fl4_dst = targets[i]; 2517 fl.fl4_dst = targets[i];
2518 fl.fl4_tos = RTO_ONLINK; 2518 fl.fl4_tos = RTO_ONLINK;
2519 2519
2520 rv = ip_route_output_key(&rt, &fl); 2520 rv = ip_route_output_key(&init_net, &rt, &fl);
2521 if (rv) { 2521 if (rv) {
2522 if (net_ratelimit()) { 2522 if (net_ratelimit()) {
2523 printk(KERN_WARNING DRV_NAME 2523 printk(KERN_WARNING DRV_NAME
diff --git a/include/net/route.h b/include/net/route.h
index 6b970d7d07e0..d9b876adbf42 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -111,7 +111,7 @@ extern 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 net *, 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 net *, struct rtable **, struct flowi *flp);
115extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 115extern int ip_route_output_flow(struct net *, 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);
117extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); 117extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 45e08620c8ca..86b885ec1cbd 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -534,7 +534,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
534 unlink_clip_vcc(clip_vcc); 534 unlink_clip_vcc(clip_vcc);
535 return 0; 535 return 0;
536 } 536 }
537 error = ip_route_output_key(&rt, &fl); 537 error = ip_route_output_key(&init_net, &rt, &fl);
538 if (error) 538 if (error)
539 return error; 539 return error;
540 neigh = __neigh_lookup(&clip_tbl, &ip, rt->u.dst.dev, 1); 540 neigh = __neigh_lookup(&clip_tbl, &ip, rt->u.dst.dev, 1);
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 141f069e77a0..80014bab81b0 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -353,7 +353,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
353 if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev)) 353 if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev))
354 goto free_skb; 354 goto free_skb;
355 355
356 if (!ip_route_output_key(&rt, &fl)) { 356 if (!ip_route_output_key(&init_net, &rt, &fl)) {
357 /* - Bridged-and-DNAT'ed traffic doesn't 357 /* - Bridged-and-DNAT'ed traffic doesn't
358 * require ip_forwarding. */ 358 * require ip_forwarding. */
359 if (((struct dst_entry *)rt)->dev == dev) { 359 if (((struct dst_entry *)rt)->dev == dev) {
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b2c19cb12063..5976c598cc4b 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -424,7 +424,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
424 int flag = 0; 424 int flag = 0;
425 /*unsigned long now; */ 425 /*unsigned long now; */
426 426
427 if (ip_route_output_key(&rt, &fl) < 0) 427 if (ip_route_output_key(&init_net, &rt, &fl) < 0)
428 return 1; 428 return 1;
429 if (rt->u.dst.dev != dev) { 429 if (rt->u.dst.dev != dev) {
430 NET_INC_STATS_BH(LINUX_MIB_ARPFILTER); 430 NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
@@ -1002,7 +1002,7 @@ static int arp_req_set(struct net *net, struct arpreq *r,
1002 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, 1002 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip,
1003 .tos = RTO_ONLINK } } }; 1003 .tos = RTO_ONLINK } } };
1004 struct rtable * rt; 1004 struct rtable * rt;
1005 if ((err = ip_route_output_key(&rt, &fl)) != 0) 1005 if ((err = ip_route_output_key(net, &rt, &fl)) != 0)
1006 return err; 1006 return err;
1007 dev = rt->u.dst.dev; 1007 dev = rt->u.dst.dev;
1008 ip_rt_put(rt); 1008 ip_rt_put(rt);
@@ -1109,7 +1109,7 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
1109 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, 1109 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip,
1110 .tos = RTO_ONLINK } } }; 1110 .tos = RTO_ONLINK } } };
1111 struct rtable * rt; 1111 struct rtable * rt;
1112 if ((err = ip_route_output_key(&rt, &fl)) != 0) 1112 if ((err = ip_route_output_key(net, &rt, &fl)) != 0)
1113 return err; 1113 return err;
1114 dev = rt->u.dst.dev; 1114 dev = rt->u.dst.dev;
1115 ip_rt_put(rt); 1115 ip_rt_put(rt);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 11760310f917..a142f19fec45 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -405,7 +405,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
405 .tos = RT_TOS(ip_hdr(skb)->tos) } }, 405 .tos = RT_TOS(ip_hdr(skb)->tos) } },
406 .proto = IPPROTO_ICMP }; 406 .proto = IPPROTO_ICMP };
407 security_skb_classify_flow(skb, &fl); 407 security_skb_classify_flow(skb, &fl);
408 if (ip_route_output_key(&rt, &fl)) 408 if (ip_route_output_key(&init_net, &rt, &fl))
409 goto out_unlock; 409 goto out_unlock;
410 } 410 }
411 if (icmpv4_xrlim_allow(rt, icmp_param->data.icmph.type, 411 if (icmpv4_xrlim_allow(rt, icmp_param->data.icmph.type,
@@ -598,7 +598,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
598 struct dst_entry *odst; 598 struct dst_entry *odst;
599 599
600 fl2.fl4_dst = fl.fl4_src; 600 fl2.fl4_dst = fl.fl4_src;
601 if (ip_route_output_key(&rt2, &fl2)) 601 if (ip_route_output_key(&init_net, &rt2, &fl2))
602 goto out_unlock; 602 goto out_unlock;
603 603
604 /* Ugh! */ 604 /* Ugh! */
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 1f5314ca109c..994648be80ab 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -301,7 +301,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
301 .nl_u = { .ip4_u = { 301 .nl_u = { .ip4_u = {
302 .daddr = IGMPV3_ALL_MCR } }, 302 .daddr = IGMPV3_ALL_MCR } },
303 .proto = IPPROTO_IGMP }; 303 .proto = IPPROTO_IGMP };
304 if (ip_route_output_key(&rt, &fl)) { 304 if (ip_route_output_key(&init_net, &rt, &fl)) {
305 kfree_skb(skb); 305 kfree_skb(skb);
306 return NULL; 306 return NULL;
307 } 307 }
@@ -645,7 +645,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
645 struct flowi fl = { .oif = dev->ifindex, 645 struct flowi fl = { .oif = dev->ifindex,
646 .nl_u = { .ip4_u = { .daddr = dst } }, 646 .nl_u = { .ip4_u = { .daddr = dst } },
647 .proto = IPPROTO_IGMP }; 647 .proto = IPPROTO_IGMP };
648 if (ip_route_output_key(&rt, &fl)) 648 if (ip_route_output_key(&init_net, &rt, &fl))
649 return -1; 649 return -1;
650 } 650 }
651 if (rt->rt_src == 0) { 651 if (rt->rt_src == 0) {
@@ -1401,7 +1401,7 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
1401 dev_put(dev); 1401 dev_put(dev);
1402 } 1402 }
1403 1403
1404 if (!dev && !ip_route_output_key(&rt, &fl)) { 1404 if (!dev && !ip_route_output_key(&init_net, &rt, &fl)) {
1405 dev = rt->u.dst.dev; 1405 dev = rt->u.dst.dev;
1406 ip_rt_put(rt); 1406 ip_rt_put(rt);
1407 } 1407 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index a74983d8c89c..63f691719353 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -480,7 +480,7 @@ out:
480 fl.fl4_dst = eiph->saddr; 480 fl.fl4_dst = eiph->saddr;
481 fl.fl4_tos = RT_TOS(eiph->tos); 481 fl.fl4_tos = RT_TOS(eiph->tos);
482 fl.proto = IPPROTO_GRE; 482 fl.proto = IPPROTO_GRE;
483 if (ip_route_output_key(&rt, &fl)) { 483 if (ip_route_output_key(&init_net, &rt, &fl)) {
484 kfree_skb(skb2); 484 kfree_skb(skb2);
485 return; 485 return;
486 } 486 }
@@ -493,7 +493,7 @@ out:
493 fl.fl4_dst = eiph->daddr; 493 fl.fl4_dst = eiph->daddr;
494 fl.fl4_src = eiph->saddr; 494 fl.fl4_src = eiph->saddr;
495 fl.fl4_tos = eiph->tos; 495 fl.fl4_tos = eiph->tos;
496 if (ip_route_output_key(&rt, &fl) || 496 if (ip_route_output_key(&init_net, &rt, &fl) ||
497 rt->u.dst.dev->type != ARPHRD_IPGRE) { 497 rt->u.dst.dev->type != ARPHRD_IPGRE) {
498 ip_rt_put(rt); 498 ip_rt_put(rt);
499 kfree_skb(skb2); 499 kfree_skb(skb2);
@@ -748,7 +748,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
748 .saddr = tiph->saddr, 748 .saddr = tiph->saddr,
749 .tos = RT_TOS(tos) } }, 749 .tos = RT_TOS(tos) } },
750 .proto = IPPROTO_GRE }; 750 .proto = IPPROTO_GRE };
751 if (ip_route_output_key(&rt, &fl)) { 751 if (ip_route_output_key(&init_net, &rt, &fl)) {
752 tunnel->stat.tx_carrier_errors++; 752 tunnel->stat.tx_carrier_errors++;
753 goto tx_error; 753 goto tx_error;
754 } 754 }
@@ -921,7 +921,7 @@ static void ipgre_tunnel_bind_dev(struct net_device *dev)
921 .tos = RT_TOS(iph->tos) } }, 921 .tos = RT_TOS(iph->tos) } },
922 .proto = IPPROTO_GRE }; 922 .proto = IPPROTO_GRE };
923 struct rtable *rt; 923 struct rtable *rt;
924 if (!ip_route_output_key(&rt, &fl)) { 924 if (!ip_route_output_key(&init_net, &rt, &fl)) {
925 tdev = rt->u.dst.dev; 925 tdev = rt->u.dst.dev;
926 ip_rt_put(rt); 926 ip_rt_put(rt);
927 } 927 }
@@ -1177,7 +1177,7 @@ static int ipgre_open(struct net_device *dev)
1177 .tos = RT_TOS(t->parms.iph.tos) } }, 1177 .tos = RT_TOS(t->parms.iph.tos) } },
1178 .proto = IPPROTO_GRE }; 1178 .proto = IPPROTO_GRE };
1179 struct rtable *rt; 1179 struct rtable *rt;
1180 if (ip_route_output_key(&rt, &fl)) 1180 if (ip_route_output_key(&init_net, &rt, &fl))
1181 return -EADDRNOTAVAIL; 1181 return -EADDRNOTAVAIL;
1182 dev = rt->u.dst.dev; 1182 dev = rt->u.dst.dev;
1183 ip_rt_put(rt); 1183 ip_rt_put(rt);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 6d78e1d6b785..1725e0613982 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1379,7 +1379,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
1379 .dport = tcp_hdr(skb)->source } }, 1379 .dport = tcp_hdr(skb)->source } },
1380 .proto = sk->sk_protocol }; 1380 .proto = sk->sk_protocol };
1381 security_skb_classify_flow(skb, &fl); 1381 security_skb_classify_flow(skb, &fl);
1382 if (ip_route_output_key(&rt, &fl)) 1382 if (ip_route_output_key(&init_net, &rt, &fl))
1383 return; 1383 return;
1384 } 1384 }
1385 1385
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 160535b51705..da281581692c 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -405,7 +405,7 @@ out:
405 fl.fl4_daddr = eiph->saddr; 405 fl.fl4_daddr = eiph->saddr;
406 fl.fl4_tos = RT_TOS(eiph->tos); 406 fl.fl4_tos = RT_TOS(eiph->tos);
407 fl.proto = IPPROTO_IPIP; 407 fl.proto = IPPROTO_IPIP;
408 if (ip_route_output_key(&rt, &key)) { 408 if (ip_route_output_key(&init_net, &rt, &key)) {
409 kfree_skb(skb2); 409 kfree_skb(skb2);
410 return 0; 410 return 0;
411 } 411 }
@@ -418,7 +418,7 @@ out:
418 fl.fl4_daddr = eiph->daddr; 418 fl.fl4_daddr = eiph->daddr;
419 fl.fl4_src = eiph->saddr; 419 fl.fl4_src = eiph->saddr;
420 fl.fl4_tos = eiph->tos; 420 fl.fl4_tos = eiph->tos;
421 if (ip_route_output_key(&rt, &fl) || 421 if (ip_route_output_key(&init_net, &rt, &fl) ||
422 rt->u.dst.dev->type != ARPHRD_TUNNEL) { 422 rt->u.dst.dev->type != ARPHRD_TUNNEL) {
423 ip_rt_put(rt); 423 ip_rt_put(rt);
424 kfree_skb(skb2); 424 kfree_skb(skb2);
@@ -547,7 +547,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
547 .saddr = tiph->saddr, 547 .saddr = tiph->saddr,
548 .tos = RT_TOS(tos) } }, 548 .tos = RT_TOS(tos) } },
549 .proto = IPPROTO_IPIP }; 549 .proto = IPPROTO_IPIP };
550 if (ip_route_output_key(&rt, &fl)) { 550 if (ip_route_output_key(&init_net, &rt, &fl)) {
551 tunnel->stat.tx_carrier_errors++; 551 tunnel->stat.tx_carrier_errors++;
552 goto tx_error_icmp; 552 goto tx_error_icmp;
553 } 553 }
@@ -668,7 +668,7 @@ static void ipip_tunnel_bind_dev(struct net_device *dev)
668 .tos = RT_TOS(iph->tos) } }, 668 .tos = RT_TOS(iph->tos) } },
669 .proto = IPPROTO_IPIP }; 669 .proto = IPPROTO_IPIP };
670 struct rtable *rt; 670 struct rtable *rt;
671 if (!ip_route_output_key(&rt, &fl)) { 671 if (!ip_route_output_key(&init_net, &rt, &fl)) {
672 tdev = rt->u.dst.dev; 672 tdev = rt->u.dst.dev;
673 ip_rt_put(rt); 673 ip_rt_put(rt);
674 } 674 }
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 221271758b93..a94f52c207a7 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1185,7 +1185,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
1185 .saddr = vif->local, 1185 .saddr = vif->local,
1186 .tos = RT_TOS(iph->tos) } }, 1186 .tos = RT_TOS(iph->tos) } },
1187 .proto = IPPROTO_IPIP }; 1187 .proto = IPPROTO_IPIP };
1188 if (ip_route_output_key(&rt, &fl)) 1188 if (ip_route_output_key(&init_net, &rt, &fl))
1189 goto out_free; 1189 goto out_free;
1190 encap = sizeof(struct iphdr); 1190 encap = sizeof(struct iphdr);
1191 } else { 1191 } else {
@@ -1194,7 +1194,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
1194 { .daddr = iph->daddr, 1194 { .daddr = iph->daddr,
1195 .tos = RT_TOS(iph->tos) } }, 1195 .tos = RT_TOS(iph->tos) } },
1196 .proto = IPPROTO_IPIP }; 1196 .proto = IPPROTO_IPIP };
1197 if (ip_route_output_key(&rt, &fl)) 1197 if (ip_route_output_key(&init_net, &rt, &fl))
1198 goto out_free; 1198 goto out_free;
1199 } 1199 }
1200 1200
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index 8436bf818590..f63006caea03 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -78,7 +78,7 @@ __ip_vs_get_out_rt(struct ip_vs_conn *cp, u32 rtos)
78 .tos = rtos, } }, 78 .tos = rtos, } },
79 }; 79 };
80 80
81 if (ip_route_output_key(&rt, &fl)) { 81 if (ip_route_output_key(&init_net, &rt, &fl)) {
82 spin_unlock(&dest->dst_lock); 82 spin_unlock(&dest->dst_lock);
83 IP_VS_DBG_RL("ip_route_output error, " 83 IP_VS_DBG_RL("ip_route_output error, "
84 "dest: %u.%u.%u.%u\n", 84 "dest: %u.%u.%u.%u\n",
@@ -101,7 +101,7 @@ __ip_vs_get_out_rt(struct ip_vs_conn *cp, u32 rtos)
101 .tos = rtos, } }, 101 .tos = rtos, } },
102 }; 102 };
103 103
104 if (ip_route_output_key(&rt, &fl)) { 104 if (ip_route_output_key(&init_net, &rt, &fl)) {
105 IP_VS_DBG_RL("ip_route_output error, dest: " 105 IP_VS_DBG_RL("ip_route_output error, dest: "
106 "%u.%u.%u.%u\n", NIPQUAD(cp->daddr)); 106 "%u.%u.%u.%u\n", NIPQUAD(cp->daddr));
107 return NULL; 107 return NULL;
@@ -170,7 +170,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
170 170
171 EnterFunction(10); 171 EnterFunction(10);
172 172
173 if (ip_route_output_key(&rt, &fl)) { 173 if (ip_route_output_key(&init_net, &rt, &fl)) {
174 IP_VS_DBG_RL("ip_vs_bypass_xmit(): ip_route_output error, " 174 IP_VS_DBG_RL("ip_vs_bypass_xmit(): ip_route_output error, "
175 "dest: %u.%u.%u.%u\n", NIPQUAD(iph->daddr)); 175 "dest: %u.%u.%u.%u\n", NIPQUAD(iph->daddr));
176 goto tx_error_icmp; 176 goto tx_error_icmp;
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 63221553d26b..9a904c6c0dc8 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -33,7 +33,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
33 fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); 33 fl.nl_u.ip4_u.tos = RT_TOS(iph->tos);
34 fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; 34 fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
35 fl.mark = skb->mark; 35 fl.mark = skb->mark;
36 if (ip_route_output_key(&rt, &fl) != 0) 36 if (ip_route_output_key(&init_net, &rt, &fl) != 0)
37 return -1; 37 return -1;
38 38
39 /* Drop old route. */ 39 /* Drop old route. */
@@ -43,7 +43,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
43 /* non-local src, find valid iif to satisfy 43 /* non-local src, find valid iif to satisfy
44 * rp-filter when calling ip_route_input. */ 44 * rp-filter when calling ip_route_input. */
45 fl.nl_u.ip4_u.daddr = iph->saddr; 45 fl.nl_u.ip4_u.daddr = iph->saddr;
46 if (ip_route_output_key(&rt, &fl) != 0) 46 if (ip_route_output_key(&init_net, &rt, &fl) != 0)
47 return -1; 47 return -1;
48 48
49 odst = skb->dst; 49 odst = skb->dst;
@@ -187,7 +187,7 @@ EXPORT_SYMBOL(nf_ip_checksum);
187 187
188static int nf_ip_route(struct dst_entry **dst, struct flowi *fl) 188static int nf_ip_route(struct dst_entry **dst, struct flowi *fl)
189{ 189{
190 return ip_route_output_key((struct rtable **)dst, fl); 190 return ip_route_output_key(&init_net, (struct rtable **)dst, fl);
191} 191}
192 192
193static const struct nf_afinfo nf_ip_afinfo = { 193static const struct nf_afinfo nf_ip_afinfo = {
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c
index 4391aec56abd..519182269e76 100644
--- a/net/ipv4/netfilter/nf_nat_rule.c
+++ b/net/ipv4/netfilter/nf_nat_rule.c
@@ -97,7 +97,7 @@ static void warn_if_extra_mangle(__be32 dstip, __be32 srcip)
97 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = dstip } } }; 97 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = dstip } } };
98 struct rtable *rt; 98 struct rtable *rt;
99 99
100 if (ip_route_output_key(&rt, &fl) != 0) 100 if (ip_route_output_key(&init_net, &rt, &fl) != 0)
101 return; 101 return;
102 102
103 if (rt->rt_src != srcip && !warned) { 103 if (rt->rt_src != srcip && !warned) {
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c75fc20b07e2..39a40342142f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2559,9 +2559,9 @@ int ip_route_output_flow(struct net *net, struct rtable **rp, struct flowi *flp,
2559 2559
2560EXPORT_SYMBOL_GPL(ip_route_output_flow); 2560EXPORT_SYMBOL_GPL(ip_route_output_flow);
2561 2561
2562int ip_route_output_key(struct rtable **rp, struct flowi *flp) 2562int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp)
2563{ 2563{
2564 return ip_route_output_flow(&init_net, rp, flp, NULL, 0); 2564 return ip_route_output_flow(net, rp, flp, NULL, 0);
2565} 2565}
2566 2566
2567static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 2567static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
@@ -2728,7 +2728,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2728 }, 2728 },
2729 .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, 2729 .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
2730 }; 2730 };
2731 err = ip_route_output_key(&rt, &fl); 2731 err = ip_route_output_key(&init_net, &rt, &fl);
2732 } 2732 }
2733 2733
2734 if (err) 2734 if (err)
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 2da1be0589a9..f470fe4511db 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -264,7 +264,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
264 { .sport = th->dest, 264 { .sport = th->dest,
265 .dport = th->source } } }; 265 .dport = th->source } } };
266 security_req_classify_flow(req, &fl); 266 security_req_classify_flow(req, &fl);
267 if (ip_route_output_key(&rt, &fl)) { 267 if (ip_route_output_key(&init_net, &rt, &fl)) {
268 reqsk_free(req); 268 reqsk_free(req);
269 goto out; 269 goto out;
270 } 270 }
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 425c9ae8b315..9031e521c1df 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -533,7 +533,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
533 fl.fl4_dst = eiph->saddr; 533 fl.fl4_dst = eiph->saddr;
534 fl.fl4_tos = RT_TOS(eiph->tos); 534 fl.fl4_tos = RT_TOS(eiph->tos);
535 fl.proto = IPPROTO_IPIP; 535 fl.proto = IPPROTO_IPIP;
536 if (ip_route_output_key(&rt, &fl)) 536 if (ip_route_output_key(&init_net, &rt, &fl))
537 goto out; 537 goto out;
538 538
539 skb2->dev = rt->u.dst.dev; 539 skb2->dev = rt->u.dst.dev;
@@ -545,7 +545,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
545 fl.fl4_dst = eiph->daddr; 545 fl.fl4_dst = eiph->daddr;
546 fl.fl4_src = eiph->saddr; 546 fl.fl4_src = eiph->saddr;
547 fl.fl4_tos = eiph->tos; 547 fl.fl4_tos = eiph->tos;
548 if (ip_route_output_key(&rt, &fl) || 548 if (ip_route_output_key(&init_net, &rt, &fl) ||
549 rt->u.dst.dev->type != ARPHRD_TUNNEL) { 549 rt->u.dst.dev->type != ARPHRD_TUNNEL) {
550 ip_rt_put(rt); 550 ip_rt_put(rt);
551 goto out; 551 goto out;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 1c6fddb80b37..e77239d02bf5 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -557,7 +557,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
557 .tos = RT_TOS(tos) } }, 557 .tos = RT_TOS(tos) } },
558 .oif = tunnel->parms.link, 558 .oif = tunnel->parms.link,
559 .proto = IPPROTO_IPV6 }; 559 .proto = IPPROTO_IPV6 };
560 if (ip_route_output_key(&rt, &fl)) { 560 if (ip_route_output_key(&init_net, &rt, &fl)) {
561 tunnel->stat.tx_carrier_errors++; 561 tunnel->stat.tx_carrier_errors++;
562 goto tx_error_icmp; 562 goto tx_error_icmp;
563 } 563 }
@@ -686,7 +686,7 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
686 .oif = tunnel->parms.link, 686 .oif = tunnel->parms.link,
687 .proto = IPPROTO_IPV6 }; 687 .proto = IPPROTO_IPV6 };
688 struct rtable *rt; 688 struct rtable *rt;
689 if (!ip_route_output_key(&rt, &fl)) { 689 if (!ip_route_output_key(&init_net, &rt, &fl)) {
690 tdev = rt->u.dst.dev; 690 tdev = rt->u.dst.dev;
691 ip_rt_put(rt); 691 ip_rt_put(rt);
692 } 692 }
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c
index 90fa107a8af9..2abe2081a5e8 100644
--- a/net/rxrpc/ar-peer.c
+++ b/net/rxrpc/ar-peer.c
@@ -57,7 +57,7 @@ static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer)
57 BUG(); 57 BUG();
58 } 58 }
59 59
60 ret = ip_route_output_key(&rt, &fl); 60 ret = ip_route_output_key(&init_net, &rt, &fl);
61 if (ret < 0) { 61 if (ret < 0) {
62 _leave(" [route err %d]", ret); 62 _leave(" [route err %d]", ret);
63 return; 63 return;
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 3f7def2936b4..1339742e49f1 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -454,7 +454,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
454 __FUNCTION__, NIPQUAD(fl.fl4_dst), 454 __FUNCTION__, NIPQUAD(fl.fl4_dst),
455 NIPQUAD(fl.fl4_src)); 455 NIPQUAD(fl.fl4_src));
456 456
457 if (!ip_route_output_key(&rt, &fl)) { 457 if (!ip_route_output_key(&init_net, &rt, &fl)) {
458 dst = &rt->u.dst; 458 dst = &rt->u.dst;
459 } 459 }
460 460
@@ -497,7 +497,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
497 if ((laddr->state == SCTP_ADDR_SRC) && 497 if ((laddr->state == SCTP_ADDR_SRC) &&
498 (AF_INET == laddr->a.sa.sa_family)) { 498 (AF_INET == laddr->a.sa.sa_family)) {
499 fl.fl4_src = laddr->a.v4.sin_addr.s_addr; 499 fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
500 if (!ip_route_output_key(&rt, &fl)) { 500 if (!ip_route_output_key(&init_net, &rt, &fl)) {
501 dst = &rt->u.dst; 501 dst = &rt->u.dst;
502 goto out_unlock; 502 goto out_unlock;
503 } 503 }