diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-03-08 10:12:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-09 16:09:20 -0500 |
commit | 4f3ed9209f7f75ff0ee21bc5052d76542dd75b5f (patch) | |
tree | bfdce03ed40959fc65a12d6d7ecb1172967e5b28 /net/ipv4/ipip.c | |
parent | 8344bfc6008d1c7b8b541bb25de7dfacb2188b95 (diff) |
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.c | 13 |
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) | |||
483 | 483 | ||
484 | if (skb->protocol != htons(ETH_P_IP)) | 484 | if (skb->protocol != htons(ETH_P_IP)) |
485 | goto tx_error; | 485 | goto tx_error; |
486 | |||
487 | if (skb->ip_summed == CHECKSUM_PARTIAL && | ||
488 | skb_checksum_help(skb)) | ||
489 | goto tx_error; | ||
490 | |||
491 | old_iph = ip_hdr(skb); | 486 | old_iph = ip_hdr(skb); |
492 | 487 | ||
493 | if (tos & 1) | 488 | if (tos & 1) |
@@ -572,6 +567,13 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
572 | old_iph = ip_hdr(skb); | 567 | old_iph = ip_hdr(skb); |
573 | } | 568 | } |
574 | 569 | ||
570 | if (!skb->encapsulation) { | ||
571 | skb_reset_inner_headers(skb); | ||
572 | skb->encapsulation = 1; | ||
573 | } | ||
574 | if (skb->ip_summed != CHECKSUM_PARTIAL) | ||
575 | skb->ip_summed = CHECKSUM_NONE; | ||
576 | |||
575 | skb->transport_header = skb->network_header; | 577 | skb->transport_header = skb->network_header; |
576 | skb_push(skb, sizeof(struct iphdr)); | 578 | skb_push(skb, sizeof(struct iphdr)); |
577 | skb_reset_network_header(skb); | 579 | 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 | iph->ttl = old_iph->ttl; | 601 | iph->ttl = old_iph->ttl; |
600 | 602 | ||
601 | nf_reset(skb); | 603 | nf_reset(skb); |
602 | skb->ip_summed = CHECKSUM_NONE; | ||
603 | 604 | ||
604 | pkt_len = skb->len - skb_transport_offset(skb); | 605 | pkt_len = skb->len - skb_transport_offset(skb); |
605 | err = ip_local_out(skb); | 606 | err = ip_local_out(skb); |