Skip to content

Commit 804cf14

Browse files
Ian Campbelldavem330
authored andcommitted
net: xfrm: convert to SKB frag APIs
Signed-off-by: Ian Campbell <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 408dadf commit 804cf14

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net/xfrm/xfrm_ipcomp.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,29 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)
7070

7171
while ((scratch += len, dlen -= len) > 0) {
7272
skb_frag_t *frag;
73+
struct page *page;
7374

7475
err = -EMSGSIZE;
7576
if (WARN_ON(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS))
7677
goto out;
7778

7879
frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags;
79-
frag->page = alloc_page(GFP_ATOMIC);
80+
page = alloc_page(GFP_ATOMIC);
8081

8182
err = -ENOMEM;
82-
if (!frag->page)
83+
if (!page)
8384
goto out;
8485

86+
__skb_frag_set_page(frag, page);
87+
8588
len = PAGE_SIZE;
8689
if (dlen < len)
8790
len = dlen;
8891

89-
memcpy(page_address(frag->page), scratch, len);
90-
9192
frag->page_offset = 0;
9293
frag->size = len;
94+
memcpy(skb_frag_address(frag), scratch, len);
95+
9396
skb->truesize += len;
9497
skb->data_len += len;
9598
skb->len += len;

0 commit comments

Comments
 (0)