aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-03 23:25:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-03 23:25:42 -0400
commit31e4543db29fb85496a122b965d6482c8d1a2bfe (patch)
tree3e49d61a1202e1b3c8c71e422f3fd8e4f2616d01 /net/ipv4/ipip.c
parentf1390160ddcd64a3cfd48b3280d0a616a31b9520 (diff)
ipv4: Make caller provide on-stack flow key to ip_route_output_ports().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index ef16377ec73f..88d96bde9500 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);