linux-3.0.x for AP-SH4A-0A Board
Revision | 97edbc901240090ca75b81aa8955bcef8d570434 (tree) |
---|---|
Time | 2011-08-05 13:58:31 |
Author | Herbert Xu <herbert@gond...> |
Commiter | Greg Kroah-Hartman |
gro: Only reset frag0 when skb can be pulled
commit 17dd759c67f21e34f2156abcf415e1f60605a188 upstream.
Currently skb_gro_header_slow unconditionally resets frag0 and
frag0_len. However, when we can't pull on the skb this leaves
the GRO fields in an inconsistent state.
This patch fixes this by only resetting those fields after the
pskb_may_pull test.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
@@ -1688,9 +1688,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) | ||
1688 | 1688 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, |
1689 | 1689 | unsigned int offset) |
1690 | 1690 | { |
1691 | + if (!pskb_may_pull(skb, hlen)) | |
1692 | + return NULL; | |
1693 | + | |
1691 | 1694 | NAPI_GRO_CB(skb)->frag0 = NULL; |
1692 | 1695 | NAPI_GRO_CB(skb)->frag0_len = 0; |
1693 | - return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; | |
1696 | + return skb->data + offset; | |
1694 | 1697 | } |
1695 | 1698 | |
1696 | 1699 | static inline void *skb_gro_mac_header(struct sk_buff *skb) |