Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv4: Make caller provide on-stack flow key to ip_route_output_ports().

Signed-off-by: David S. Miller <davem@davemloft.net>

+47 -30
+2 -1
drivers/infiniband/hw/cxgb3/iwch_cm.c
··· 338 338 __be16 peer_port, u8 tos) 339 339 { 340 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 344 peer_port, local_port, IPPROTO_TCP, 344 345 tos, 0); 345 346 if (IS_ERR(rt))
+2 -1
drivers/infiniband/hw/cxgb4/cm.c
··· 315 315 __be16 peer_port, u8 tos) 316 316 { 317 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 321 peer_port, local_port, IPPROTO_TCP, 321 322 tos, 0); 322 323 if (IS_ERR(rt))
+4 -2
drivers/net/pptp.c
··· 175 175 struct pptp_opt *opt = &po->proto.pptp; 176 176 struct pptp_gre_header *hdr; 177 177 unsigned int header_len = sizeof(*hdr); 178 + struct flowi4 fl4; 178 179 int islcp; 179 180 int len; 180 181 unsigned char *data; ··· 190 189 if (sk_pppox(po)->sk_state & PPPOX_DEAD) 191 190 goto tx_error; 192 191 193 - rt = ip_route_output_ports(&init_net, NULL, 192 + rt = ip_route_output_ports(&init_net, &fl4, NULL, 194 193 opt->dst_addr.sin_addr.s_addr, 195 194 opt->src_addr.sin_addr.s_addr, 196 195 0, 0, IPPROTO_GRE, ··· 435 434 struct pppox_sock *po = pppox_sk(sk); 436 435 struct pptp_opt *opt = &po->proto.pptp; 437 436 struct rtable *rt; 437 + struct flowi4 fl4; 438 438 int error = 0; 439 439 440 440 if (sp->sa_protocol != PX_PROTO_PPTP) ··· 465 463 po->chan.private = sk; 466 464 po->chan.ops = &pptp_chan_ops; 467 465 468 - rt = ip_route_output_ports(&init_net, sk, 466 + rt = ip_route_output_ports(&init_net, &fl4, sk, 469 467 opt->dst_addr.sin_addr.s_addr, 470 468 opt->src_addr.sin_addr.s_addr, 471 469 0, 0,
+2 -1
drivers/scsi/cxgbi/libcxgbi.c
··· 454 454 __be16 sport, __be16 dport, u8 tos) 455 455 { 456 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 460 dport, sport, IPPROTO_TCP, tos, 0); 460 461 if (IS_ERR(rt)) 461 462 return NULL;
+5 -6
include/net/route.h
··· 137 137 return ip_route_output_key(net, &fl4); 138 138 } 139 139 140 - static inline struct rtable *ip_route_output_ports(struct net *net, struct sock *sk, 140 + static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4, 141 + struct sock *sk, 141 142 __be32 daddr, __be32 saddr, 142 143 __be16 dport, __be16 sport, 143 144 __u8 proto, __u8 tos, int oif) 144 145 { 145 - struct flowi4 fl4; 146 - 147 - flowi4_init_output(&fl4, oif, sk ? sk->sk_mark : 0, tos, 146 + flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos, 148 147 RT_SCOPE_UNIVERSE, proto, 149 148 sk ? inet_sk_flowi_flags(sk) : 0, 150 149 daddr, saddr, dport, sport); 151 150 if (sk) 152 - security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); 153 - return ip_route_output_flow(net, &fl4, sk); 151 + security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); 152 + return ip_route_output_flow(net, fl4, sk); 154 153 } 155 154 156 155 static inline struct rtable *ip_route_output_gre(struct net *net,
+2 -1
net/ipv4/af_inet.c
··· 1152 1152 struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); 1153 1153 __be32 daddr; 1154 1154 struct ip_options_rcu *inet_opt; 1155 + struct flowi4 fl4; 1155 1156 int err; 1156 1157 1157 1158 /* Route is OK, nothing to do. */ ··· 1166 1165 if (inet_opt && inet_opt->opt.srr) 1167 1166 daddr = inet_opt->opt.faddr; 1168 1167 rcu_read_unlock(); 1169 - rt = ip_route_output_ports(sock_net(sk), sk, daddr, inet->inet_saddr, 1168 + rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr, inet->inet_saddr, 1170 1169 inet->inet_dport, inet->inet_sport, 1171 1170 sk->sk_protocol, RT_CONN_FLAGS(sk), 1172 1171 sk->sk_bound_dev_if);
+4 -2
net/ipv4/igmp.c
··· 309 309 struct iphdr *pip; 310 310 struct igmpv3_report *pig; 311 311 struct net *net = dev_net(dev); 312 + struct flowi4 fl4; 312 313 313 314 while (1) { 314 315 skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), ··· 322 321 } 323 322 igmp_skb_size(skb) = size; 324 323 325 - rt = ip_route_output_ports(net, NULL, IGMPV3_ALL_MCR, 0, 324 + rt = ip_route_output_ports(net, &fl4, NULL, IGMPV3_ALL_MCR, 0, 326 325 0, 0, 327 326 IPPROTO_IGMP, 0, dev->ifindex); 328 327 if (IS_ERR(rt)) { ··· 651 650 struct net_device *dev = in_dev->dev; 652 651 struct net *net = dev_net(dev); 653 652 __be32 group = pmc ? pmc->multiaddr : 0; 653 + struct flowi4 fl4; 654 654 __be32 dst; 655 655 656 656 if (type == IGMPV3_HOST_MEMBERSHIP_REPORT) ··· 661 659 else 662 660 dst = group; 663 661 664 - rt = ip_route_output_ports(net, NULL, dst, 0, 662 + rt = ip_route_output_ports(net, &fl4, NULL, dst, 0, 665 663 0, 0, 666 664 IPPROTO_IGMP, 0, dev->ifindex); 667 665 if (IS_ERR(rt))
+2 -1
net/ipv4/ip_output.c
··· 333 333 /* Make sure we can route this packet. */ 334 334 rt = (struct rtable *)__sk_dst_check(sk, 0); 335 335 if (rt == NULL) { 336 + struct flowi4 fl4; 336 337 __be32 daddr; 337 338 338 339 /* Use correct destination address if we have options. */ ··· 345 344 * keep trying until route appears or the connection times 346 345 * itself out. 347 346 */ 348 - rt = ip_route_output_ports(sock_net(sk), sk, 347 + rt = ip_route_output_ports(sock_net(sk), &fl4, sk, 349 348 daddr, inet->inet_saddr, 350 349 inet->inet_dport, 351 350 inet->inet_sport,
+10 -7
net/ipv4/ipip.c
··· 442 442 struct iphdr *iph; /* Our new IP header */ 443 443 unsigned int max_headroom; /* The extra header space needed */ 444 444 __be32 dst = tiph->daddr; 445 + struct flowi4 fl4; 445 446 int mtu; 446 447 447 448 if (skb->protocol != htons(ETH_P_IP)) ··· 461 460 goto tx_error_icmp; 462 461 } 463 462 464 - rt = ip_route_output_ports(dev_net(dev), NULL, 463 + rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, 465 464 dst, tiph->saddr, 466 465 0, 0, 467 466 IPPROTO_IPIP, RT_TOS(tos), ··· 579 578 iph = &tunnel->parms.iph; 580 579 581 580 if (iph->daddr) { 582 - struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 583 - iph->daddr, iph->saddr, 584 - 0, 0, 585 - IPPROTO_IPIP, 586 - RT_TOS(iph->tos), 587 - tunnel->parms.link); 581 + struct rtable *rt; 582 + struct flowi4 fl4; 588 583 584 + rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, 585 + iph->daddr, iph->saddr, 586 + 0, 0, 587 + IPPROTO_IPIP, 588 + RT_TOS(iph->tos), 589 + tunnel->parms.link); 589 590 if (!IS_ERR(rt)) { 590 591 tdev = rt->dst.dev; 591 592 ip_rt_put(rt);
+3 -2
net/ipv4/ipmr.c
··· 1595 1595 struct vif_device *vif = &mrt->vif_table[vifi]; 1596 1596 struct net_device *dev; 1597 1597 struct rtable *rt; 1598 + struct flowi4 fl4; 1598 1599 int encap = 0; 1599 1600 1600 1601 if (vif->dev == NULL) ··· 1613 1612 #endif 1614 1613 1615 1614 if (vif->flags & VIFF_TUNNEL) { 1616 - rt = ip_route_output_ports(net, NULL, 1615 + rt = ip_route_output_ports(net, &fl4, NULL, 1617 1616 vif->remote, vif->local, 1618 1617 0, 0, 1619 1618 IPPROTO_IPIP, ··· 1622 1621 goto out_free; 1623 1622 encap = sizeof(struct iphdr); 1624 1623 } else { 1625 - rt = ip_route_output_ports(net, NULL, iph->daddr, 0, 1624 + rt = ip_route_output_ports(net, &fl4, NULL, iph->daddr, 0, 1626 1625 0, 0, 1627 1626 IPPROTO_IPIP, 1628 1627 RT_TOS(iph->tos), vif->link);
+3 -2
net/ipv6/ip6_tunnel.c
··· 537 537 struct sk_buff *skb2; 538 538 const struct iphdr *eiph; 539 539 struct rtable *rt; 540 + struct flowi4 fl4; 540 541 541 542 err = ip6_tnl_err(skb, IPPROTO_IPIP, opt, &rel_type, &rel_code, 542 543 &rel_msg, &rel_info, offset); ··· 578 577 eiph = ip_hdr(skb2); 579 578 580 579 /* Try to guess incoming interface */ 581 - rt = ip_route_output_ports(dev_net(skb->dev), NULL, 580 + rt = ip_route_output_ports(dev_net(skb->dev), &fl4, NULL, 582 581 eiph->saddr, 0, 583 582 0, 0, 584 583 IPPROTO_IPIP, RT_TOS(eiph->tos), 0); ··· 591 590 if (rt->rt_flags & RTCF_LOCAL) { 592 591 ip_rt_put(rt); 593 592 rt = NULL; 594 - rt = ip_route_output_ports(dev_net(skb->dev), NULL, 593 + rt = ip_route_output_ports(dev_net(skb->dev), &fl4, NULL, 595 594 eiph->daddr, eiph->saddr, 596 595 0, 0, 597 596 IPPROTO_IPIP,
+4 -2
net/ipv6/sit.c
··· 674 674 struct iphdr *iph; /* Our new IP header */ 675 675 unsigned int max_headroom; /* The extra header space needed */ 676 676 __be32 dst = tiph->daddr; 677 + struct flowi4 fl4; 677 678 int mtu; 678 679 const struct in6_addr *addr6; 679 680 int addr_type; ··· 734 733 dst = addr6->s6_addr32[3]; 735 734 } 736 735 737 - rt = ip_route_output_ports(dev_net(dev), NULL, 736 + rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, 738 737 dst, tiph->saddr, 739 738 0, 0, 740 739 IPPROTO_IPV6, RT_TOS(tos), ··· 852 851 struct net_device *tdev = NULL; 853 852 struct ip_tunnel *tunnel; 854 853 const struct iphdr *iph; 854 + struct flowi4 fl4; 855 855 856 856 tunnel = netdev_priv(dev); 857 857 iph = &tunnel->parms.iph; 858 858 859 859 if (iph->daddr) { 860 - struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, 860 + struct rtable *rt = ip_route_output_ports(dev_net(dev), &fl4, NULL, 861 861 iph->daddr, iph->saddr, 862 862 0, 0, 863 863 IPPROTO_IPV6,
+2 -1
net/l2tp/l2tp_ip.c
··· 471 471 472 472 if (rt == NULL) { 473 473 struct ip_options_rcu *inet_opt; 474 + struct flowi4 fl4; 474 475 475 476 rcu_read_lock(); 476 477 inet_opt = rcu_dereference(inet->inet_opt); ··· 486 485 * keep trying until route appears or the connection times 487 486 * itself out. 488 487 */ 489 - rt = ip_route_output_ports(sock_net(sk), sk, 488 + rt = ip_route_output_ports(sock_net(sk), &fl4, sk, 490 489 daddr, inet->inet_saddr, 491 490 inet->inet_dport, inet->inet_sport, 492 491 sk->sk_protocol, RT_CONN_FLAGS(sk),
+2 -1
net/rxrpc/ar-peer.c
··· 36 36 static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) 37 37 { 38 38 struct rtable *rt; 39 + struct flowi4 fl4; 39 40 40 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 44 peer->srx.transport.sin.sin_addr.s_addr, 0, 44 45 htons(7000), htons(7001), 45 46 IPPROTO_UDP, 0, 0);