diff options
-rw-r--r-- | net/core/dev.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index cd29e613bc5a..ed4550fd9ece 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2452,10 +2452,25 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | |||
2452 | ret = GRO_HELD; | 2452 | ret = GRO_HELD; |
2453 | 2453 | ||
2454 | pull: | 2454 | pull: |
2455 | if (unlikely(!pskb_may_pull(skb, skb_gro_offset(skb)))) { | 2455 | if (skb_headlen(skb) < skb_gro_offset(skb)) { |
2456 | if (napi->gro_list == skb) | 2456 | int grow = skb_gro_offset(skb) - skb_headlen(skb); |
2457 | napi->gro_list = skb->next; | 2457 | |
2458 | ret = GRO_DROP; | 2458 | BUG_ON(skb->end - skb->tail < grow); |
2459 | |||
2460 | memcpy(skb_tail_pointer(skb), NAPI_GRO_CB(skb)->frag0, grow); | ||
2461 | |||
2462 | skb->tail += grow; | ||
2463 | skb->data_len -= grow; | ||
2464 | |||
2465 | skb_shinfo(skb)->frags[0].page_offset += grow; | ||
2466 | skb_shinfo(skb)->frags[0].size -= grow; | ||
2467 | |||
2468 | if (unlikely(!skb_shinfo(skb)->frags[0].size)) { | ||
2469 | put_page(skb_shinfo(skb)->frags[0].page); | ||
2470 | memmove(skb_shinfo(skb)->frags, | ||
2471 | skb_shinfo(skb)->frags + 1, | ||
2472 | --skb_shinfo(skb)->nr_frags); | ||
2473 | } | ||
2459 | } | 2474 | } |
2460 | 2475 | ||
2461 | ok: | 2476 | ok: |