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 19abcc9d6a1a..7ee5cb96db34 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -641,11 +641,7 @@ static int ipip_rcv(struct sk_buff *skb) | |||
641 | const struct iphdr *iph; | 641 | const struct iphdr *iph; |
642 | struct ip_tunnel *tunnel; | 642 | struct ip_tunnel *tunnel; |
643 | 643 | ||
644 | if (iptunnel_pull_header(skb, 0, tpi.proto)) | ||
645 | goto drop; | ||
646 | |||
647 | iph = ip_hdr(skb); | 644 | iph = ip_hdr(skb); |
648 | |||
649 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, | 645 | tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, |
650 | iph->saddr, iph->daddr); | 646 | iph->saddr, iph->daddr); |
651 | if (tunnel != NULL) { | 647 | if (tunnel != NULL) { |
@@ -655,6 +651,8 @@ static int ipip_rcv(struct sk_buff *skb) | |||
655 | 651 | ||
656 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) | 652 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) |
657 | goto drop; | 653 | goto drop; |
654 | if (iptunnel_pull_header(skb, 0, tpi.proto)) | ||
655 | goto drop; | ||
658 | return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); | 656 | return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); |
659 | } | 657 | } |
660 | 658 | ||
@@ -881,6 +879,11 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
881 | ttl = iph6->hop_limit; | 879 | ttl = iph6->hop_limit; |
882 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); | 880 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); |
883 | 881 | ||
882 | if (likely(!skb->encapsulation)) { | ||
883 | skb_reset_inner_headers(skb); | ||
884 | skb->encapsulation = 1; | ||
885 | } | ||
886 | |||
884 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos, | 887 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos, |
885 | ttl, df, !net_eq(tunnel->net, dev_net(dev))); | 888 | ttl, df, !net_eq(tunnel->net, dev_net(dev))); |
886 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 889 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |