diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 3534ceaa4fba..43b33373adb2 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -732,17 +732,14 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
732 | dst = addr6->s6_addr32[3]; | 732 | dst = addr6->s6_addr32[3]; |
733 | } | 733 | } |
734 | 734 | ||
735 | { | 735 | rt = ip_route_output_ports(dev_net(dev), NULL, |
736 | struct flowi fl = { .fl4_dst = dst, | 736 | dst, tiph->saddr, |
737 | .fl4_src = tiph->saddr, | 737 | 0, 0, |
738 | .fl4_tos = RT_TOS(tos), | 738 | IPPROTO_IPV6, RT_TOS(tos), |
739 | .oif = tunnel->parms.link, | 739 | tunnel->parms.link); |
740 | .proto = IPPROTO_IPV6 }; | 740 | if (IS_ERR(rt)) { |
741 | rt = ip_route_output_key(dev_net(dev), &fl); | 741 | dev->stats.tx_carrier_errors++; |
742 | if (IS_ERR(rt)) { | 742 | goto tx_error_icmp; |
743 | dev->stats.tx_carrier_errors++; | ||
744 | goto tx_error_icmp; | ||
745 | } | ||
746 | } | 743 | } |
747 | if (rt->rt_type != RTN_UNICAST) { | 744 | if (rt->rt_type != RTN_UNICAST) { |
748 | ip_rt_put(rt); | 745 | ip_rt_put(rt); |
@@ -858,12 +855,12 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev) | |||
858 | iph = &tunnel->parms.iph; | 855 | iph = &tunnel->parms.iph; |
859 | 856 | ||
860 | if (iph->daddr) { | 857 | if (iph->daddr) { |
861 | struct flowi fl = { .fl4_dst = iph->daddr, | 858 | struct rtable *rt = ip_route_output_ports(dev_net(dev), NULL, |
862 | .fl4_src = iph->saddr, | 859 | iph->daddr, iph->saddr, |
863 | .fl4_tos = RT_TOS(iph->tos), | 860 | 0, 0, |
864 | .oif = tunnel->parms.link, | 861 | IPPROTO_IPV6, |
865 | .proto = IPPROTO_IPV6 }; | 862 | RT_TOS(iph->tos), |
866 | struct rtable *rt = ip_route_output_key(dev_net(dev), &fl); | 863 | tunnel->parms.link); |
867 | 864 | ||
868 | if (!IS_ERR(rt)) { | 865 | if (!IS_ERR(rt)) { |
869 | tdev = rt->dst.dev; | 866 | tdev = rt->dst.dev; |