diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index a3437a4cd07e..21b25dd8466b 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -645,11 +645,7 @@ static int ipip_rcv(struct sk_buff *skb) | |||
645 | const struct iphdr *iph; | 645 | const struct iphdr *iph; |
646 | struct ip_tunnel *tunnel; | 646 | struct ip_tunnel *tunnel; |
647 | 647 | ||
648 | if (iptunnel_pull_header(skb, 0, tpi.proto)) | ||
649 | goto drop; | ||
650 | |||
651 | iph = ip_hdr(skb); | 648 | iph = ip_hdr(skb); |
652 | |||
653 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, | 649 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, |
654 | iph->saddr, iph->daddr); | 650 | iph->saddr, iph->daddr); |
655 | if (tunnel != NULL) { | 651 | if (tunnel != NULL) { |
@@ -659,6 +655,8 @@ static int ipip_rcv(struct sk_buff *skb) | |||
659 | 655 | ||
660 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) | 656 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) |
661 | goto drop; | 657 | goto drop; |
658 | if (iptunnel_pull_header(skb, 0, tpi.proto)) | ||
659 | goto drop; | ||
662 | return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); | 660 | return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); |
663 | } | 661 | } |
664 | 662 | ||
@@ -888,6 +886,11 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
888 | ttl = iph6->hop_limit; | 886 | ttl = iph6->hop_limit; |
889 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); | 887 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); |
890 | 888 | ||
889 | if (likely(!skb->encapsulation)) { | ||
890 | skb_reset_inner_headers(skb); | ||
891 | skb->encapsulation = 1; | ||
892 | } | ||
893 | |||
891 | err = iptunnel_xmit(dev_net(dev), rt, skb, fl4.saddr, fl4.daddr, | 894 | err = iptunnel_xmit(dev_net(dev), rt, skb, fl4.saddr, fl4.daddr, |
892 | IPPROTO_IPV6, tos, ttl, df); | 895 | IPPROTO_IPV6, tos, ttl, df); |
893 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 896 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |