summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-01-17 19:48:13 +0000
committerDavid S. Miller <davem@davemloft.net>2009-01-20 14:44:03 -0800
commit37fe4732b978eb02e5433387a40f2b61706cebe3 (patch)
tree476bd415def668118e0fa34a25ef2032e3ed14e7 /net
parent9a8e47ffd95608f0768e1a8a0225c822aa53aa9b (diff)
downloadop-kernel-dev-37fe4732b978eb02e5433387a40f2b61706cebe3.zip
op-kernel-dev-37fe4732b978eb02e5433387a40f2b61706cebe3.tar.gz
gro: Fix merging of paged packets
The previous fix to paged packets broke the merging because it reset the skb->len before we added it to the merged packet. This wasn't detected because it simply resulted in the truncation of the packet while the missing bit is subsequently retransmitted. The fix is to store skb->len before we clobber it. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 56272ac..2e5f2ca 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2585,8 +2585,9 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
struct sk_buff *nskb;
unsigned int headroom;
unsigned int hlen = p->data - skb_mac_header(p);
+ unsigned int len = skb->len;
- if (hlen + p->len + skb->len >= 65536)
+ if (hlen + p->len + len >= 65536)
return -E2BIG;
if (skb_shinfo(p)->frag_list)
@@ -2648,9 +2649,9 @@ merge:
done:
NAPI_GRO_CB(p)->count++;
- p->data_len += skb->len;
- p->truesize += skb->len;
- p->len += skb->len;
+ p->data_len += len;
+ p->truesize += len;
+ p->len += len;
NAPI_GRO_CB(skb)->same_flow = 1;
return 0;
OpenPOWER on IntegriCloud