diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2011-07-27 09:16:28 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-07-27 09:16:28 -0400 |
| commit | 17dd759c67f21e34f2156abcf415e1f60605a188 (patch) | |
| tree | 991e4406ec835cf4cbb8108a6307c35f3164007b /include/linux | |
| parent | 2d348d1f569f051d2609b04d27bb55cd25eda8fe (diff) | |
gro: Only reset frag0 when skb can be pulled
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netdevice.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1d92acc0777b..661a07746e94 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1649,9 +1649,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) | |||
| 1649 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, | 1649 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, |
| 1650 | unsigned int offset) | 1650 | unsigned int offset) |
| 1651 | { | 1651 | { |
| 1652 | if (!pskb_may_pull(skb, hlen)) | ||
| 1653 | return NULL; | ||
| 1654 | |||
| 1652 | NAPI_GRO_CB(skb)->frag0 = NULL; | 1655 | NAPI_GRO_CB(skb)->frag0 = NULL; |
| 1653 | NAPI_GRO_CB(skb)->frag0_len = 0; | 1656 | NAPI_GRO_CB(skb)->frag0_len = 0; |
| 1654 | return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; | 1657 | return skb->data + offset; |
| 1655 | } | 1658 | } |
| 1656 | 1659 | ||
| 1657 | static inline void *skb_gro_mac_header(struct sk_buff *skb) | 1660 | static inline void *skb_gro_mac_header(struct sk_buff *skb) |
