diff options
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 8f024d41eef..34e006fe2d8 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -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: |