Skip to content

Commit

Permalink
gro: Fix merging of paged packets
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 20, 2009
1 parent 9a8e47f commit 37fe473
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -2648,9 +2649,9 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)

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;
Expand Down

0 comments on commit 37fe473

Please sign in to comment.