Skip to content

Commit f206351

Browse files
dlunevdavem330
authored andcommitted
[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>
1 parent f1b050b commit f206351

21 files changed

Lines changed: 44 additions & 44 deletions

File tree

‎drivers/infiniband/core/addr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
158158

159159
memset(&fl, 0, sizeof fl);
160160
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))
162162
return;
163163

164164
neigh_event_send(rt->u.dst.neighbour, NULL);
@@ -179,7 +179,7 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
179179
memset(&fl, 0, sizeof fl);
180180
fl.nl_u.ip4_u.daddr = dst_ip;
181181
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);
183183
if (ret)
184184
goto out;
185185

‎drivers/net/bonding/bond_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
25172517
fl.fl4_dst = targets[i];
25182518
fl.fl4_tos = RTO_ONLINK;
25192519

2520-
rv = ip_route_output_key(&rt, &fl);
2520+
rv = ip_route_output_key(&init_net, &rt, &fl);
25212521
if (rv) {
25222522
if (net_ratelimit()) {
25232523
printk(KERN_WARNING DRV_NAME

‎include/net/route.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
111111
__be32 src, struct net_device *dev);
112112
extern void rt_cache_flush(int how);
113113
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
114-
extern int ip_route_output_key(struct rtable **, struct flowi *flp);
114+
extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
115115
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
116116
extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
117117
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);

‎net/atm/clip.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
534534
unlink_clip_vcc(clip_vcc);
535535
return 0;
536536
}
537-
error = ip_route_output_key(&rt, &fl);
537+
error = ip_route_output_key(&init_net, &rt, &fl);
538538
if (error)
539539
return error;
540540
neigh = __neigh_lookup(&clip_tbl, &ip, rt->u.dst.dev, 1);

‎net/bridge/br_netfilter.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
353353
if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev))
354354
goto free_skb;
355355

356-
if (!ip_route_output_key(&rt, &fl)) {
356+
if (!ip_route_output_key(&init_net, &rt, &fl)) {
357357
/* - Bridged-and-DNAT'ed traffic doesn't
358358
* require ip_forwarding. */
359359
if (((struct dst_entry *)rt)->dev == dev) {

‎net/ipv4/arp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
424424
int flag = 0;
425425
/*unsigned long now; */
426426

427-
if (ip_route_output_key(&rt, &fl) < 0)
427+
if (ip_route_output_key(&init_net, &rt, &fl) < 0)
428428
return 1;
429429
if (rt->u.dst.dev != dev) {
430430
NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
@@ -1002,7 +1002,7 @@ static int arp_req_set(struct net *net, struct arpreq *r,
10021002
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip,
10031003
.tos = RTO_ONLINK } } };
10041004
struct rtable * rt;
1005-
if ((err = ip_route_output_key(&rt, &fl)) != 0)
1005+
if ((err = ip_route_output_key(net, &rt, &fl)) != 0)
10061006
return err;
10071007
dev = rt->u.dst.dev;
10081008
ip_rt_put(rt);
@@ -1109,7 +1109,7 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
11091109
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip,
11101110
.tos = RTO_ONLINK } } };
11111111
struct rtable * rt;
1112-
if ((err = ip_route_output_key(&rt, &fl)) != 0)
1112+
if ((err = ip_route_output_key(net, &rt, &fl)) != 0)
11131113
return err;
11141114
dev = rt->u.dst.dev;
11151115
ip_rt_put(rt);

‎net/ipv4/icmp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
405405
.tos = RT_TOS(ip_hdr(skb)->tos) } },
406406
.proto = IPPROTO_ICMP };
407407
security_skb_classify_flow(skb, &fl);
408-
if (ip_route_output_key(&rt, &fl))
408+
if (ip_route_output_key(&init_net, &rt, &fl))
409409
goto out_unlock;
410410
}
411411
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)
598598
struct dst_entry *odst;
599599

600600
fl2.fl4_dst = fl.fl4_src;
601-
if (ip_route_output_key(&rt2, &fl2))
601+
if (ip_route_output_key(&init_net, &rt2, &fl2))
602602
goto out_unlock;
603603

604604
/* Ugh! */

‎net/ipv4/igmp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
301301
.nl_u = { .ip4_u = {
302302
.daddr = IGMPV3_ALL_MCR } },
303303
.proto = IPPROTO_IGMP };
304-
if (ip_route_output_key(&rt, &fl)) {
304+
if (ip_route_output_key(&init_net, &rt, &fl)) {
305305
kfree_skb(skb);
306306
return NULL;
307307
}
@@ -645,7 +645,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
645645
struct flowi fl = { .oif = dev->ifindex,
646646
.nl_u = { .ip4_u = { .daddr = dst } },
647647
.proto = IPPROTO_IGMP };
648-
if (ip_route_output_key(&rt, &fl))
648+
if (ip_route_output_key(&init_net, &rt, &fl))
649649
return -1;
650650
}
651651
if (rt->rt_src == 0) {
@@ -1401,7 +1401,7 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
14011401
dev_put(dev);
14021402
}
14031403

1404-
if (!dev && !ip_route_output_key(&rt, &fl)) {
1404+
if (!dev && !ip_route_output_key(&init_net, &rt, &fl)) {
14051405
dev = rt->u.dst.dev;
14061406
ip_rt_put(rt);
14071407
}

‎net/ipv4/ip_gre.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
480480
fl.fl4_dst = eiph->saddr;
481481
fl.fl4_tos = RT_TOS(eiph->tos);
482482
fl.proto = IPPROTO_GRE;
483-
if (ip_route_output_key(&rt, &fl)) {
483+
if (ip_route_output_key(&init_net, &rt, &fl)) {
484484
kfree_skb(skb2);
485485
return;
486486
}
@@ -493,7 +493,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
493493
fl.fl4_dst = eiph->daddr;
494494
fl.fl4_src = eiph->saddr;
495495
fl.fl4_tos = eiph->tos;
496-
if (ip_route_output_key(&rt, &fl) ||
496+
if (ip_route_output_key(&init_net, &rt, &fl) ||
497497
rt->u.dst.dev->type != ARPHRD_IPGRE) {
498498
ip_rt_put(rt);
499499
kfree_skb(skb2);
@@ -748,7 +748,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
748748
.saddr = tiph->saddr,
749749
.tos = RT_TOS(tos) } },
750750
.proto = IPPROTO_GRE };
751-
if (ip_route_output_key(&rt, &fl)) {
751+
if (ip_route_output_key(&init_net, &rt, &fl)) {
752752
tunnel->stat.tx_carrier_errors++;
753753
goto tx_error;
754754
}
@@ -921,7 +921,7 @@ static void ipgre_tunnel_bind_dev(struct net_device *dev)
921921
.tos = RT_TOS(iph->tos) } },
922922
.proto = IPPROTO_GRE };
923923
struct rtable *rt;
924-
if (!ip_route_output_key(&rt, &fl)) {
924+
if (!ip_route_output_key(&init_net, &rt, &fl)) {
925925
tdev = rt->u.dst.dev;
926926
ip_rt_put(rt);
927927
}
@@ -1177,7 +1177,7 @@ static int ipgre_open(struct net_device *dev)
11771177
.tos = RT_TOS(t->parms.iph.tos) } },
11781178
.proto = IPPROTO_GRE };
11791179
struct rtable *rt;
1180-
if (ip_route_output_key(&rt, &fl))
1180+
if (ip_route_output_key(&init_net, &rt, &fl))
11811181
return -EADDRNOTAVAIL;
11821182
dev = rt->u.dst.dev;
11831183
ip_rt_put(rt);

‎net/ipv4/ip_output.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
13791379
.dport = tcp_hdr(skb)->source } },
13801380
.proto = sk->sk_protocol };
13811381
security_skb_classify_flow(skb, &fl);
1382-
if (ip_route_output_key(&rt, &fl))
1382+
if (ip_route_output_key(&init_net, &rt, &fl))
13831383
return;
13841384
}
13851385

0 commit comments

Comments
 (0)