• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

linux-3.0.x for AP-SH4A-0A Board


Commit MetaInfo

Revision97edbc901240090ca75b81aa8955bcef8d570434 (tree)
Time2011-08-05 13:58:31
AuthorHerbert Xu <herbert@gond...>
CommiterGreg Kroah-Hartman

Log Message

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>

Change Summary

Incremental Difference

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1688,9 +1688,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
16881688 static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
16891689 unsigned int offset)
16901690 {
1691+ if (!pskb_may_pull(skb, hlen))
1692+ return NULL;
1693+
16911694 NAPI_GRO_CB(skb)->frag0 = NULL;
16921695 NAPI_GRO_CB(skb)->frag0_len = 0;
1693- return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL;
1696+ return skb->data + offset;
16941697 }
16951698
16961699 static inline void *skb_gro_mac_header(struct sk_buff *skb)