summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2013-03-08 15:12:52 +0000
committerDavid S. Miller <davem@davemloft.net>2013-03-09 16:09:20 -0500
commit4f3ed9209f7f75ff0ee21bc5052d76542dd75b5f (patch)
treebfdce03ed40959fc65a12d6d7ecb1172967e5b28 /net/ipv4/ipip.c
parent8344bfc6008d1c7b8b541bb25de7dfacb2188b95 (diff)
downloadlinux-4f3ed9209f7f75ff0ee21bc5052d76542dd75b5f.tar.bz2
ipip: capture inner headers during encapsulation
Allow IPIP to make use of tx-checksum offloading. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 18f535299ef9..b50435ba0ce5 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -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))
goto tx_error;
-
- if (skb->ip_summed == CHECKSUM_PARTIAL &&
- skb_checksum_help(skb))
- goto tx_error;
-
old_iph = ip_hdr(skb);
if (tos & 1)
@@ -572,6 +567,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);
@@ -599,7 +601,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
iph->ttl = old_iph->ttl;
nf_reset(skb);
- skb->ip_summed = CHECKSUM_NONE;
pkt_len = skb->len - skb_transport_offset(skb);
err = ip_local_out(skb);