diff options
author | Eric Dumazet <edumazet@google.com> | 2012-10-08 15:38:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-08 15:40:43 -0400 |
commit | 863472454ce50d4ef0929c6aa738cc5d64b84679 (patch) | |
tree | 10a938801074b41e53c8237c92390e745b47a521 /net | |
parent | 48cc32d38a52d0b68f91a171a8d00531edc6a46e (diff) |
ipv6: gro: fix PV6_GRO_CB(skb)->proto problem
It seems IPV6_GRO_CB(skb)->proto can be destroyed in skb_gro_receive()
if a new skb is allocated (to serve as an anchor for frag_list)
We copy NAPI_GRO_CB() only (not the IPV6 specific part) in :
*NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p);
So we leave IPV6_GRO_CB(nskb)->proto to 0 (fresh skb allocation) instead
of IPPROTO_TCP (6)
ipv6_gro_complete() isnt able to call ops->gro_complete()
[ tcp6_gro_complete() ]
Fix this by moving proto in NAPI_GRO_CB() and getting rid of
IPV6_GRO_CB
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/af_inet6.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index f757e3b7cfbf..a974247a9ae4 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -822,13 +822,6 @@ out: | |||
822 | return segs; | 822 | return segs; |
823 | } | 823 | } |
824 | 824 | ||
825 | struct ipv6_gro_cb { | ||
826 | struct napi_gro_cb napi; | ||
827 | int proto; | ||
828 | }; | ||
829 | |||
830 | #define IPV6_GRO_CB(skb) ((struct ipv6_gro_cb *)(skb)->cb) | ||
831 | |||
832 | static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | 825 | static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, |
833 | struct sk_buff *skb) | 826 | struct sk_buff *skb) |
834 | { | 827 | { |
@@ -874,7 +867,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | |||
874 | iph = ipv6_hdr(skb); | 867 | iph = ipv6_hdr(skb); |
875 | } | 868 | } |
876 | 869 | ||
877 | IPV6_GRO_CB(skb)->proto = proto; | 870 | NAPI_GRO_CB(skb)->proto = proto; |
878 | 871 | ||
879 | flush--; | 872 | flush--; |
880 | nlen = skb_network_header_len(skb); | 873 | nlen = skb_network_header_len(skb); |
@@ -930,7 +923,7 @@ static int ipv6_gro_complete(struct sk_buff *skb) | |||
930 | sizeof(*iph)); | 923 | sizeof(*iph)); |
931 | 924 | ||
932 | rcu_read_lock(); | 925 | rcu_read_lock(); |
933 | ops = rcu_dereference(inet6_protos[IPV6_GRO_CB(skb)->proto]); | 926 | ops = rcu_dereference(inet6_protos[NAPI_GRO_CB(skb)->proto]); |
934 | if (WARN_ON(!ops || !ops->gro_complete)) | 927 | if (WARN_ON(!ops || !ops->gro_complete)) |
935 | goto out_unlock; | 928 | goto out_unlock; |
936 | 929 | ||