aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c3
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c3
-rw-r--r--drivers/net/pptp.c6
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c3
-rw-r--r--include/net/route.h11
-rw-r--r--net/ipv4/af_inet.c3
-rw-r--r--net/ipv4/igmp.c6
-rw-r--r--net/ipv4/ip_output.c3
-rw-r--r--net/ipv4/ipip.c19
-rw-r--r--net/ipv4/ipmr.c5
-rw-r--r--net/ipv6/ip6_tunnel.c5
-rw-r--r--net/ipv6/sit.c6
-rw-r--r--net/l2tp/l2tp_ip.c3
-rw-r--r--net/rxrpc/ar-peer.c3
14 files changed, 48 insertions, 31 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 3216bcad7e8..23918413899 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -338,8 +338,9 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
338 __be16 peer_port, u8 tos) 338 __be16 peer_port, u8 tos)
339{ 339{
340 struct rtable *rt; 340 struct rtable *rt;
341 struct flowi4 fl4;
341 342
342 rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip, 343 rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip,
343 peer_port, local_port, IPPROTO_TCP, 344 peer_port, local_port, IPPROTO_TCP,
344 tos, 0); 345 tos, 0);
345 if (IS_ERR(rt)) 346 if (IS_ERR(rt))
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 9d8dcfab2b3..6aa53cd6947 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -315,8 +315,9 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
315 __be16 peer_port, u8 tos) 315 __be16 peer_port, u8 tos)
316{ 316{
317 struct rtable *rt; 317 struct rtable *rt;
318 struct flowi4 fl4;
318 319
319 rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip, 320 rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip,
320 peer_port, local_port, IPPROTO_TCP, 321 peer_port, local_port, IPPROTO_TCP,
321 tos, 0); 322 tos, 0);
322 if (IS_ERR(rt)) 323 if (IS_ERR(rt))
diff --git a/drivers/net/pptp.c b/drivers/net/pptp.c
index 51dfcf8023c..e771e8d27eb 100644
--- a/drivers/net/pptp.c
+++ b/drivers/net/pptp.c
@@ -175,6 +175,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
175 struct pptp_opt *opt = &po->proto.pptp; 175 struct pptp_opt *opt = &po->proto.pptp;
176 struct pptp_gre_header *hdr; 176 struct pptp_gre_header *hdr;
177 unsigned int header_len = sizeof(*hdr); 177 unsigned int header_len = sizeof(*hdr);
178 struct flowi4 fl4;
178 int islcp; 179 int islcp;
179 int len; 180 int len;
180 unsigned char *data; 181 unsigned char *data;
@@ -189,7 +190,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
189 if (sk_pppox(po)->sk_state & PPPOX_DEAD) 190 if (sk_pppox(po)->sk_state & PPPOX_DEAD)
190 goto tx_error; 191 goto tx_error;
191 192
192 rt = ip_route_output_ports(&init_net, NULL, 193 rt = ip_route_output_ports(&init_net, &fl4, NULL,
193 opt->dst_addr.sin_addr.s_addr, 194 opt->dst_addr.sin_addr.s_addr,
194 opt->src_addr.sin_addr.s_addr, 195 opt->src_addr.sin_addr.s_addr,
195 0, 0, IPPROTO_GRE, 196 0, 0, IPPROTO_GRE,
@@ -434,6 +435,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
434 struct pppox_sock *po = pppox_sk(sk); 435 struct pppox_sock *po = pppox_sk(sk);
435 struct pptp_opt *opt = &po->proto.pptp; 436 struct pptp_opt *opt = &po->proto.pptp;
436 struct rtable *rt; 437 struct rtable *rt;
438 struct flowi4 fl4;
437 int error = 0; 439 int error = 0;
438 440
439 if (sp->sa_protocol != PX_PROTO_PPTP) 441 if (sp->sa_protocol != PX_PROTO_PPTP)
@@ -463,7 +465,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
463 po->chan.private = sk; 465 po->chan.private = sk;
464 po->chan.ops = &pptp_chan_ops; 466 po->chan.ops = &pptp_chan_ops;
465 467
466 rt = ip_route_output_ports(&init_net, sk, 468 rt = ip_route_output_ports(&init_net, &fl4, sk,
467 opt->dst_addr.sin_addr.s_addr, 469 opt->dst_addr.sin_addr.s_addr,
468 opt->src_addr.sin_addr.s_addr, 470 opt->src_addr.sin_addr.s_addr,
469 0, 0, 471 0, 0,
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index de764ea7419..0c33d250c7d 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -454,8 +454,9 @@ static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr,
454 __be16 sport, __be16 dport, u8 tos) 454 __be16 sport, __be16 dport, u8 tos)
455{ 455{
456 struct rtable *rt; 456 struct rtable *rt;
457 struct flowi4 fl4;
457 458
458 rt = ip_route_output_ports(&init_net, NULL, daddr, saddr, 459 rt = ip_route_output_ports(&init_net, &fl4, NULL, daddr, saddr,
459 dport, sport, IPPROTO_TCP, tos, 0); 460 dport, sport, IPPROTO_TCP, tos, 0);
460 if (IS_ERR(rt)) 461 if (IS_ERR(rt))
461 return NULL; 462 return NULL;
diff --git a/include/net/route.h b/include/net/route.h
index f07609e8314..8c02c871a8c 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -137,20 +137,19 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
137 return ip_route_output_key(net, &fl4); 137 return ip_route_output_key(net, &fl4);
138} 138}
139 139
140static inline struct rtable *ip_route_output_ports(struct net *net, struct sock *sk, 140static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4,
141 struct sock *sk,
141 __be32 daddr, __be32 saddr, 142 __be32 daddr, __be32 saddr,
142 __be16 dport, __be16 sport, 143 __be16 dport, __be16 sport,
143 __u8 proto, __u8 tos, int oif) 144 __u8 proto, __u8 tos, int oif)
144{ 145{
145 struct flowi4 fl4; 146 flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos,
146
147 flowi4_init_output(&fl4, oif, sk ? sk->sk_mark : 0, tos,
148 RT_SCOPE_UNIVERSE, proto, 147 RT_SCOPE_UNIVERSE, proto,
149 sk ? inet_sk_flowi_flags(sk) : 0, 148 sk ? inet_sk_flowi_flags(sk) : 0,
150 daddr, saddr, dport, sport); 149 daddr, saddr, dport, sport);
151 if (sk) 150 if (sk)
152 security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); 151 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
153 return ip_route_output_flow(net, &fl4, sk); 152 return ip_route_output_flow(net, fl4, sk);
154} 153}
155 154
156static inline struct rtable *ip_route_output_gre(struct net *net, 155static inline struct rtable *ip_route_output_gre(struct net *net,
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 4e734992e26..7b91fa8bf83 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1152,6 +1152,7 @@ int inet_sk_rebuild_header(struct sock *sk)
1152 struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); 1152 struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0);
1153 __be32 daddr; 1153 __be32 daddr;
1154 struct ip_options_rcu *inet_opt; 1154 struct ip_options_rcu *inet_opt;
1155 struct flowi4 fl4;
1155 int err; 1156 int err;
1156 1157
1157 /* Route is OK, nothing to do. */ 1158 /* Route is OK, nothing to do. */
@@ -1165,7 +1166,7 @@ int inet_sk_rebuild_header(struct sock *sk)
1165 if (inet_opt && inet_opt->opt.srr) 1166 if (inet_opt && inet_opt->opt.srr)
1166 daddr = inet_opt->opt.faddr; 1167 daddr = inet_opt->opt.faddr;
1167 rcu_read_unlock(); 1168 rcu_read_unlock();
1168 rt = ip_route_output_ports(sock_net(sk), sk, daddr, inet->inet_saddr, 1169 rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr, inet->inet_saddr,
1169 inet->inet_dport, inet->inet_sport, 1170 inet->inet_dport, inet->inet_sport,
1170 sk->sk_protocol, RT_CONN_FLAGS(sk), 1171 sk->sk_protocol, RT_CONN_FLAGS(sk),
1171 sk->sk_bound_dev_if); 1172 sk->sk_bound_dev_if);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 8ae0a5702f5..7c2ef59e3f7 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -309,6 +309,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
309 struct iphdr *pip; 309 struct iphdr *pip;
310 struct igmpv3_report *pig; 310 struct igmpv3_report *pig;
311 struct net *net = dev_net(dev); 311 struct net *net = dev_net(dev);
312 struct flowi4 fl4;
312 313
313 while (1) { 314 while (1) {
314 skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), 315 skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev),
@@ -321,7 +322,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
321 } 322 }
322 igmp_skb_size(skb) = size; 323 igmp_skb_size(skb) = size;
323 324
324 rt = ip_route_output_ports(net, NULL, IGMPV3_ALL_MCR, 0, 325 rt = ip_route_output_ports(net, &fl4, NULL, IGMPV3_ALL_MCR, 0,
325 0, 0, 326 0, 0,
326 IPPROTO_IGMP, 0, dev->ifindex); 327 IPPROTO_IGMP, 0, dev->ifindex);
327 if (IS_ERR(rt)) { 328 if (IS_ERR(rt)) {
@@ -650,6 +651,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
650 struct net_device *dev = in_dev->dev; 651 struct net_device *dev = in_dev->dev;
651 struct net *net = dev_net(dev); 652 struct net *net = dev_net(dev);
652 __be32 group = pmc ? pmc->multiaddr : 0; 653 __be32 group = pmc ? pmc->multiaddr : 0;
654 struct flowi4 fl4;
653 __be32 dst; 655 __be32 dst;
654 656
655 if (type == IGMPV3_HOST_MEMBERSHIP_REPORT) 657 if (type == IGMPV3_HOST_MEMBERSHIP_REPORT)
@@ -659,7 +661,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
659 else 661 else
660 dst = group; 662 dst = group;
661 663
662 rt = ip_route_output_ports(net, NULL, dst, 0, 664 rt = ip_route_output_ports(net, &fl4, NULL, dst, 0,
663 0, 0, 665 0, 0,
664 IPPROTO_IGMP, 0, dev->ifindex); 666 IPPROTO_IGMP, 0, dev->ifindex);
665 if (IS_ERR(rt)) 667 if (IS_ERR(rt))
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 362e66f7d2f..3aa4c31e544 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -333,6 +333,7 @@ int ip_queue_xmit(struct sk_buff *skb)
333 /* Make sure we can route this packet. */ 333 /* Make sure we can route this packet. */
334 rt = (struct rtable *)__sk_dst_check(sk, 0); 334 rt = (struct rtable *)__sk_dst_check(sk, 0);
335 if (rt == NULL) { 335 if (rt == NULL) {
336 struct flowi4 fl4;
336 __be32 daddr; 337 __be32 daddr;
337 338
338 /* Use correct destination address if we have options. */ 339 /* Use correct destination address if we have options. */
@@ -344,7 +345,7 @@ int ip_queue_xmit(struct sk_buff *skb)
344 * keep trying until route appears or the connection times 345 * keep trying until route appears or the connection times
345 * itself out. 346 * itself out.
346 */ 347 */
347 rt = ip_route_output_ports(sock_net(sk), sk, 348 rt = ip_route_output_ports(sock_net(sk), &fl4, sk,
348 daddr, inet->inet_saddr, 349 daddr, inet->inet_saddr,
349 inet->inet_dport, 350 inet->inet_dport,
350 inet->inet_sport, 351 inet->inet_sport,
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index ef16377ec73..88d96bde950 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -442,6 +442,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
442 struct iphdr *iph; /* Our new IP header */ 442 struct iphdr *iph; /* Our new IP header */
443 unsigned int max_headroom; /* The extra header space needed */ 443 unsigned int max_headroom; /* The extra header space needed */
444 __be32 dst = tiph->daddr; 444 __be32 dst = tiph->daddr;
445 struct flowi4 fl4;
445 int mtu; 446 int mtu;
446 447
447 if (skb->protocol != htons(ETH_P_IP)) 448 if (skb->protocol != htons(ETH_P_IP))
@@ -460,7 +461,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
460 goto tx_error_icmp; 461 goto tx_error_icmp;
461 } 462 }
462 463
463 rt = ip_route_output_ports(dev_net(dev), NULL, 464 rt = ip_route_output_ports(dev_net(dev), &fl4, NULL,
464 dst, tiph->saddr, 465 dst, tiph->saddr,
465 0, 0, 466 0, 0,
466 IPPROTO_IPIP, RT_TOS(tos), 467 IPPROTO_IPIP, RT_TOS(tos),
@@ -578,13 +579,15 @@ static void ipip_tunnel_bind_dev(struct net_device *dev)
578 iph = &tunnel->parms.iph; 579 iph = &tunnel->parms.iph;
579 580
580 if (iph->daddr) { 581 if (iph->daddr) {
581 struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 582 struct rtable *rt;
582 iph->daddr, iph->saddr, 583 struct flowi4 fl4;
583 0, 0, 584
584 IPPROTO_IPIP, 585 rt = ip_route_output_ports(dev_net(dev), &fl4, NULL,
585 RT_TOS(iph->tos), 586 iph->daddr, iph->saddr,
586 tunnel->parms.link); 587 0, 0,
587 588 IPPROTO_IPIP,
589 RT_TOS(iph->tos),
590 tunnel->parms.link);
588 if (!IS_ERR(rt)) { 591 if (!IS_ERR(rt)) {
589 tdev = rt->dst.dev; 592 tdev = rt->dst.dev;
590 ip_rt_put(rt); 593 ip_rt_put(rt);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 3ad38a44958..86033b7a05b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1595,6 +1595,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
1595 struct vif_device *vif = &mrt->vif_table[vifi]; 1595 struct vif_device *vif = &mrt->vif_table[vifi];
1596 struct net_device *dev; 1596 struct net_device *dev;
1597 struct rtable *rt; 1597 struct rtable *rt;
1598 struct flowi4 fl4;
1598 int encap = 0; 1599 int encap = 0;
1599 1600
1600 if (vif->dev == NULL) 1601 if (vif->dev == NULL)
@@ -1612,7 +1613,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
1612#endif 1613#endif
1613 1614
1614 if (vif->flags & VIFF_TUNNEL) { 1615 if (vif->flags & VIFF_TUNNEL) {
1615 rt = ip_route_output_ports(net, NULL, 1616 rt = ip_route_output_ports(net, &fl4, NULL,
1616 vif->remote, vif->local, 1617 vif->remote, vif->local,
1617 0, 0, 1618 0, 0,
1618 IPPROTO_IPIP, 1619 IPPROTO_IPIP,
@@ -1621,7 +1622,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
1621 goto out_free; 1622 goto out_free;
1622 encap = sizeof(struct iphdr); 1623 encap = sizeof(struct iphdr);
1623 } else { 1624 } else {
1624 rt = ip_route_output_ports(net, NULL, iph->daddr, 0, 1625 rt = ip_route_output_ports(net, &fl4, NULL, iph->daddr, 0,
1625 0, 0, 1626 0, 0,
1626 IPPROTO_IPIP, 1627 IPPROTO_IPIP,
1627 RT_TOS(iph->tos), vif->link); 1628 RT_TOS(iph->tos), vif->link);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 9dd0e964b8b..3dff27cba95 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -537,6 +537,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
537 struct sk_buff *skb2; 537 struct sk_buff *skb2;
538 const struct iphdr *eiph; 538 const struct iphdr *eiph;
539 struct rtable *rt; 539 struct rtable *rt;
540 struct flowi4 fl4;
540 541
541 err = ip6_tnl_err(skb, IPPROTO_IPIP, opt, &rel_type, &rel_code, 542 err = ip6_tnl_err(skb, IPPROTO_IPIP, opt, &rel_type, &rel_code,
542 &rel_msg, &rel_info, offset); 543 &rel_msg, &rel_info, offset);
@@ -577,7 +578,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
577 eiph = ip_hdr(skb2); 578 eiph = ip_hdr(skb2);
578 579
579 /* Try to guess incoming interface */ 580 /* Try to guess incoming interface */
580 rt = ip_route_output_ports(dev_net(skb->dev), NULL, 581 rt = ip_route_output_ports(dev_net(skb->dev), &fl4, NULL,
581 eiph->saddr, 0, 582 eiph->saddr, 0,
582 0, 0, 583 0, 0,
583 IPPROTO_IPIP, RT_TOS(eiph->tos), 0); 584 IPPROTO_IPIP, RT_TOS(eiph->tos), 0);
@@ -590,7 +591,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
590 if (rt->rt_flags & RTCF_LOCAL) { 591 if (rt->rt_flags & RTCF_LOCAL) {
591 ip_rt_put(rt); 592 ip_rt_put(rt);
592 rt = NULL; 593 rt = NULL;
593 rt = ip_route_output_ports(dev_net(skb->dev), NULL, 594 rt = ip_route_output_ports(dev_net(skb->dev), &fl4, NULL,
594 eiph->daddr, eiph->saddr, 595 eiph->daddr, eiph->saddr,
595 0, 0, 596 0, 0,
596 IPPROTO_IPIP, 597 IPPROTO_IPIP,
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 34d89642670..a24fb14d91f 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -674,6 +674,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
674 struct iphdr *iph; /* Our new IP header */ 674 struct iphdr *iph; /* Our new IP header */
675 unsigned int max_headroom; /* The extra header space needed */ 675 unsigned int max_headroom; /* The extra header space needed */
676 __be32 dst = tiph->daddr; 676 __be32 dst = tiph->daddr;
677 struct flowi4 fl4;
677 int mtu; 678 int mtu;
678 const struct in6_addr *addr6; 679 const struct in6_addr *addr6;
679 int addr_type; 680 int addr_type;
@@ -733,7 +734,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
733 dst = addr6->s6_addr32[3]; 734 dst = addr6->s6_addr32[3];
734 } 735 }
735 736
736 rt = ip_route_output_ports(dev_net(dev), NULL, 737 rt = ip_route_output_ports(dev_net(dev), &fl4, NULL,
737 dst, tiph->saddr, 738 dst, tiph->saddr,
738 0, 0, 739 0, 0,
739 IPPROTO_IPV6, RT_TOS(tos), 740 IPPROTO_IPV6, RT_TOS(tos),
@@ -851,12 +852,13 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
851 struct net_device *tdev = NULL; 852 struct net_device *tdev = NULL;
852 struct ip_tunnel *tunnel; 853 struct ip_tunnel *tunnel;
853 const struct iphdr *iph; 854 const struct iphdr *iph;
855 struct flowi4 fl4;
854 856
855 tunnel = netdev_priv(dev); 857 tunnel = netdev_priv(dev);
856 iph = &tunnel->parms.iph; 858 iph = &tunnel->parms.iph;
857 859
858 if (iph->daddr) { 860 if (iph->daddr) {
859 struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 861 struct rtable *rt = ip_route_output_ports(dev_net(dev), &fl4, NULL,
860 iph->daddr, iph->saddr, 862 iph->daddr, iph->saddr,
861 0, 0, 863 0, 0,
862 IPPROTO_IPV6, 864 IPPROTO_IPV6,
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index a4d2dfa1fdb..81899600abe 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -471,6 +471,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
471 471
472 if (rt == NULL) { 472 if (rt == NULL) {
473 struct ip_options_rcu *inet_opt; 473 struct ip_options_rcu *inet_opt;
474 struct flowi4 fl4;
474 475
475 rcu_read_lock(); 476 rcu_read_lock();
476 inet_opt = rcu_dereference(inet->inet_opt); 477 inet_opt = rcu_dereference(inet->inet_opt);
@@ -485,7 +486,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
485 * keep trying until route appears or the connection times 486 * keep trying until route appears or the connection times
486 * itself out. 487 * itself out.
487 */ 488 */
488 rt = ip_route_output_ports(sock_net(sk), sk, 489 rt = ip_route_output_ports(sock_net(sk), &fl4, sk,
489 daddr, inet->inet_saddr, 490 daddr, inet->inet_saddr,
490 inet->inet_dport, inet->inet_sport, 491 inet->inet_dport, inet->inet_sport,
491 sk->sk_protocol, RT_CONN_FLAGS(sk), 492 sk->sk_protocol, RT_CONN_FLAGS(sk),
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c
index 55b93dc60d0..b6ff06351d6 100644
--- a/net/rxrpc/ar-peer.c
+++ b/net/rxrpc/ar-peer.c
@@ -36,10 +36,11 @@ static void rxrpc_destroy_peer(struct work_struct *work);
36static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) 36static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer)
37{ 37{
38 struct rtable *rt; 38 struct rtable *rt;
39 struct flowi4 fl4;
39 40
40 peer->if_mtu = 1500; 41 peer->if_mtu = 1500;
41 42
42 rt = ip_route_output_ports(&init_net, NULL, 43 rt = ip_route_output_ports(&init_net, &fl4, NULL,
43 peer->srx.transport.sin.sin_addr.s_addr, 0, 44 peer->srx.transport.sin.sin_addr.s_addr, 0,
44 htons(7000), htons(7001), 45 htons(7000), htons(7001),
45 IPPROTO_UDP, 0, 0); 46 IPPROTO_UDP, 0, 0);