aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_tunnel.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-02 17:31:35 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-02 17:31:35 -0500
commitb23dd4fe42b455af5c6e20966b7d6959fa8352ea (patch)
treebf97323eae9a8d084170e573ff2c0c40bc72c3cd /net/ipv6/ip6_tunnel.c
parent452edd598f60522c11f7f88fdbab27eb36509d1a (diff)
ipv4: Make output route lookup return rtable directly.
Instead of on the stack. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r--net/ipv6/ip6_tunnel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index da43038ae18e..02730ef26b0f 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -581,7 +581,8 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
581 fl.fl4_dst = eiph->saddr; 581 fl.fl4_dst = eiph->saddr;
582 fl.fl4_tos = RT_TOS(eiph->tos); 582 fl.fl4_tos = RT_TOS(eiph->tos);
583 fl.proto = IPPROTO_IPIP; 583 fl.proto = IPPROTO_IPIP;
584 if (ip_route_output_key(dev_net(skb->dev), &rt, &fl)) 584 rt = ip_route_output_key(dev_net(skb->dev), &fl);
585 if (IS_ERR(rt))
585 goto out; 586 goto out;
586 587
587 skb2->dev = rt->dst.dev; 588 skb2->dev = rt->dst.dev;
@@ -593,12 +594,14 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
593 fl.fl4_dst = eiph->daddr; 594 fl.fl4_dst = eiph->daddr;
594 fl.fl4_src = eiph->saddr; 595 fl.fl4_src = eiph->saddr;
595 fl.fl4_tos = eiph->tos; 596 fl.fl4_tos = eiph->tos;
596 if (ip_route_output_key(dev_net(skb->dev), &rt, &fl) || 597 rt = ip_route_output_key(dev_net(skb->dev), &fl);
598 if (IS_ERR(rt) ||
597 rt->dst.dev->type != ARPHRD_TUNNEL) { 599 rt->dst.dev->type != ARPHRD_TUNNEL) {
598 ip_rt_put(rt); 600 if (!IS_ERR(rt))
601 ip_rt_put(rt);
599 goto out; 602 goto out;
600 } 603 }
601 skb_dst_set(skb2, (struct dst_entry *)rt); 604 skb_dst_set(skb2, &rt->dst);
602 } else { 605 } else {
603 ip_rt_put(rt); 606 ip_rt_put(rt);
604 if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, 607 if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,