]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ipip.c
tunnel: use iptunnel_xmit() again
[karo-tx-linux.git] / net / ipv4 / ipip.c
index 8f024d41eefa9d828af4969b84134e8c94087ffd..34e006fe2d870a57607e3d3abc51747e39ec6992 100644 (file)
@@ -481,11 +481,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (skb->protocol != htons(ETH_P_IP))
                goto tx_error;
-
-       if (skb->ip_summed == CHECKSUM_PARTIAL &&
-           skb_checksum_help(skb))
-               goto tx_error;
-
        old_iph = ip_hdr(skb);
 
        if (tos & 1)
@@ -570,6 +565,13 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
                old_iph = ip_hdr(skb);
        }
 
+       if (!skb->encapsulation) {
+               skb_reset_inner_headers(skb);
+               skb->encapsulation = 1;
+       }
+       if (skb->ip_summed != CHECKSUM_PARTIAL)
+               skb->ip_summed = CHECKSUM_NONE;
+
        skb->transport_header = skb->network_header;
        skb_push(skb, sizeof(struct iphdr));
        skb_reset_network_header(skb);
@@ -591,11 +593,13 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        iph->tos                =       INET_ECN_encapsulate(tos, old_iph->tos);
        iph->daddr              =       fl4.daddr;
        iph->saddr              =       fl4.saddr;
+       tunnel_ip_select_ident(skb, old_iph, &rt->dst);
 
        if ((iph->ttl = tiph->ttl) == 0)
                iph->ttl        =       old_iph->ttl;
 
        iptunnel_xmit(skb, dev);
+
        return NETDEV_TX_OK;
 
 tx_error_icmp: