diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 9997026b44b2..b29ab61b029c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1533,7 +1533,6 @@ struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, | |||
1533 | skb_shinfo(skb)->nr_frags = npages; | 1533 | skb_shinfo(skb)->nr_frags = npages; |
1534 | for (i = 0; i < npages; i++) { | 1534 | for (i = 0; i < npages; i++) { |
1535 | struct page *page; | 1535 | struct page *page; |
1536 | skb_frag_t *frag; | ||
1537 | 1536 | ||
1538 | page = alloc_pages(sk->sk_allocation, 0); | 1537 | page = alloc_pages(sk->sk_allocation, 0); |
1539 | if (!page) { | 1538 | if (!page) { |
@@ -1543,12 +1542,11 @@ struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, | |||
1543 | goto failure; | 1542 | goto failure; |
1544 | } | 1543 | } |
1545 | 1544 | ||
1546 | frag = &skb_shinfo(skb)->frags[i]; | 1545 | __skb_fill_page_desc(skb, i, |
1547 | frag->page = page; | 1546 | page, 0, |
1548 | frag->page_offset = 0; | 1547 | (data_len >= PAGE_SIZE ? |
1549 | frag->size = (data_len >= PAGE_SIZE ? | 1548 | PAGE_SIZE : |
1550 | PAGE_SIZE : | 1549 | data_len)); |
1551 | data_len); | ||
1552 | data_len -= PAGE_SIZE; | 1550 | data_len -= PAGE_SIZE; |
1553 | } | 1551 | } |
1554 | 1552 | ||