]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ip_tunnel_core.c
arm: imx: tx6: mfgtool defconfig
[karo-tx-linux.git] / net / ipv4 / ip_tunnel_core.c
index bcf206c79005de251e3c71e387d17e0f928e4aef..f4c987bb7e94a45fd72c245a323fb4cedade4078 100644 (file)
@@ -74,7 +74,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
        iph->daddr      =       dst;
        iph->saddr      =       src;
        iph->ttl        =       ttl;
-       __ip_select_ident(iph, &rt->dst, (skb_shinfo(skb)->gso_segs ?: 1) - 1);
+       __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1);
 
        err = ip_local_out_sk(sk, skb);
        if (unlikely(net_xmit_eval(err)))
@@ -135,6 +135,14 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb,
                return skb;
        }
 
+       /* If packet is not gso and we are resolving any partial checksum,
+        * clear encapsulation flag. This allows setting CHECKSUM_PARTIAL
+        * on the outer header without confusing devices that implement
+        * NETIF_F_IP_CSUM with encapsulation.
+        */
+       if (csum_help)
+               skb->encapsulation = 0;
+
        if (skb->ip_summed == CHECKSUM_PARTIAL && csum_help) {
                err = skb_checksum_help(skb);
                if (unlikely(err))