aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-01-17 14:46:16 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-20 17:44:01 -0500
commitebad18e93fbc6bc63ee734edbc0eb38ac6b919c0 (patch)
treefb8eb7b04eb3b304f0a104b1c3d2ffa5642dc55a /net/ipv6
parent0d1cfd20cc5f785d5345d249d4b6a6f84b29e6a6 (diff)
gro: Fix handling of complete checksums in IPv6
We need to perform skb_postpull_rcsum after pulling the IPv6 header in order to maintain the correctness of the complete checksum. This patch also adds a missing iph reload after pulling. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 94f74f5b0cbf..c802bc1658a8 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -797,6 +797,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
797 unsigned int nlen; 797 unsigned int nlen;
798 int flush = 1; 798 int flush = 1;
799 int proto; 799 int proto;
800 __wsum csum;
800 801
801 if (unlikely(!pskb_may_pull(skb, sizeof(*iph)))) 802 if (unlikely(!pskb_may_pull(skb, sizeof(*iph))))
802 goto out; 803 goto out;
@@ -808,6 +809,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
808 809
809 rcu_read_lock(); 810 rcu_read_lock();
810 proto = ipv6_gso_pull_exthdrs(skb, iph->nexthdr); 811 proto = ipv6_gso_pull_exthdrs(skb, iph->nexthdr);
812 iph = ipv6_hdr(skb);
811 IPV6_GRO_CB(skb)->proto = proto; 813 IPV6_GRO_CB(skb)->proto = proto;
812 ops = rcu_dereference(inet6_protos[proto]); 814 ops = rcu_dereference(inet6_protos[proto]);
813 if (!ops || !ops->gro_receive) 815 if (!ops || !ops->gro_receive)
@@ -839,8 +841,13 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
839 841
840 NAPI_GRO_CB(skb)->flush |= flush; 842 NAPI_GRO_CB(skb)->flush |= flush;
841 843
844 csum = skb->csum;
845 skb_postpull_rcsum(skb, iph, skb_network_header_len(skb));
846
842 pp = ops->gro_receive(head, skb); 847 pp = ops->gro_receive(head, skb);
843 848
849 skb->csum = csum;
850
844out_unlock: 851out_unlock:
845 rcu_read_unlock(); 852 rcu_read_unlock();
846 853