Commit 4f3ed920 authored by Pravin B Shelar's avatar Pravin B Shelar Committed by David S. Miller

ipip: capture inner headers during encapsulation

Allow IPIP to make use of tx-checksum offloading.
Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8344bfc6
...@@ -483,11 +483,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -483,11 +483,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->protocol != htons(ETH_P_IP)) if (skb->protocol != htons(ETH_P_IP))
goto tx_error; goto tx_error;
if (skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
goto tx_error;
old_iph = ip_hdr(skb); old_iph = ip_hdr(skb);
if (tos & 1) if (tos & 1)
...@@ -572,6 +567,13 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -572,6 +567,13 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
old_iph = ip_hdr(skb); 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->transport_header = skb->network_header;
skb_push(skb, sizeof(struct iphdr)); skb_push(skb, sizeof(struct iphdr));
skb_reset_network_header(skb); skb_reset_network_header(skb);
...@@ -599,7 +601,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -599,7 +601,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
iph->ttl = old_iph->ttl; iph->ttl = old_iph->ttl;
nf_reset(skb); nf_reset(skb);
skb->ip_summed = CHECKSUM_NONE;
pkt_len = skb->len - skb_transport_offset(skb); pkt_len = skb->len - skb_transport_offset(skb);
err = ip_local_out(skb); err = ip_local_out(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment