diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-02 17:31:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-02 17:31:35 -0500 |
commit | b23dd4fe42b455af5c6e20966b7d6959fa8352ea (patch) | |
tree | bf97323eae9a8d084170e573ff2c0c40bc72c3cd /net/ipv6/sit.c | |
parent | 452edd598f60522c11f7f88fdbab27eb36509d1a (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/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b1599a345c10..b8c8adbd7cf6 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -738,7 +738,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
738 | .fl4_tos = RT_TOS(tos), | 738 | .fl4_tos = RT_TOS(tos), |
739 | .oif = tunnel->parms.link, | 739 | .oif = tunnel->parms.link, |
740 | .proto = IPPROTO_IPV6 }; | 740 | .proto = IPPROTO_IPV6 }; |
741 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 741 | rt = ip_route_output_key(dev_net(dev), &fl); |
742 | if (IS_ERR(rt)) { | ||
742 | dev->stats.tx_carrier_errors++; | 743 | dev->stats.tx_carrier_errors++; |
743 | goto tx_error_icmp; | 744 | goto tx_error_icmp; |
744 | } | 745 | } |
@@ -862,8 +863,9 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev) | |||
862 | .fl4_tos = RT_TOS(iph->tos), | 863 | .fl4_tos = RT_TOS(iph->tos), |
863 | .oif = tunnel->parms.link, | 864 | .oif = tunnel->parms.link, |
864 | .proto = IPPROTO_IPV6 }; | 865 | .proto = IPPROTO_IPV6 }; |
865 | struct rtable *rt; | 866 | struct rtable *rt = ip_route_output_key(dev_net(dev), &fl); |
866 | if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { | 867 | |
868 | if (!IS_ERR(rt)) { | ||
867 | tdev = rt->dst.dev; | 869 | tdev = rt->dst.dev; |
868 | ip_rt_put(rt); | 870 | ip_rt_put(rt); |
869 | } | 871 | } |