diff options
-rw-r--r-- | net/core/dev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index df406dcf7482..ec5be1c7f2f1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2533,6 +2533,8 @@ struct sk_buff *napi_fraginfo_skb(struct napi_struct *napi, | |||
2533 | struct net_device *dev = napi->dev; | 2533 | struct net_device *dev = napi->dev; |
2534 | struct sk_buff *skb = napi->skb; | 2534 | struct sk_buff *skb = napi->skb; |
2535 | struct ethhdr *eth; | 2535 | struct ethhdr *eth; |
2536 | skb_frag_t *frag; | ||
2537 | int i; | ||
2536 | 2538 | ||
2537 | napi->skb = NULL; | 2539 | napi->skb = NULL; |
2538 | 2540 | ||
@@ -2545,8 +2547,14 @@ struct sk_buff *napi_fraginfo_skb(struct napi_struct *napi, | |||
2545 | } | 2547 | } |
2546 | 2548 | ||
2547 | BUG_ON(info->nr_frags > MAX_SKB_FRAGS); | 2549 | BUG_ON(info->nr_frags > MAX_SKB_FRAGS); |
2550 | frag = &info->frags[info->nr_frags - 1]; | ||
2551 | |||
2552 | for (i = skb_shinfo(skb)->nr_frags; i < info->nr_frags; i++) { | ||
2553 | skb_fill_page_desc(skb, i, frag->page, frag->page_offset, | ||
2554 | frag->size); | ||
2555 | frag++; | ||
2556 | } | ||
2548 | skb_shinfo(skb)->nr_frags = info->nr_frags; | 2557 | skb_shinfo(skb)->nr_frags = info->nr_frags; |
2549 | memcpy(skb_shinfo(skb)->frags, info->frags, sizeof(info->frags)); | ||
2550 | 2558 | ||
2551 | skb->data_len = info->len; | 2559 | skb->data_len = info->len; |
2552 | skb->len += info->len; | 2560 | skb->len += info->len; |