Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265531
b: refs/heads/master
c: 804cf14
h: refs/heads/master
i:
  265529: daa3648
  265527: 108ca52
v: v3
  • Loading branch information
Ian Campbell authored and David S. Miller committed Aug 25, 2011
1 parent 1e1a28a commit 084b372
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 408dadf03fe365f12f85d5c3d959f4bb888b9f3e
refs/heads/master: 804cf14ea5ceca46554d5801e2817bba8116b7e5
11 changes: 7 additions & 4 deletions trunk/net/xfrm/xfrm_ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,29 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)

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

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

frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags;
frag->page = alloc_page(GFP_ATOMIC);
page = alloc_page(GFP_ATOMIC);

err = -ENOMEM;
if (!frag->page)
if (!page)
goto out;

__skb_frag_set_page(frag, page);

len = PAGE_SIZE;
if (dlen < len)
len = dlen;

memcpy(page_address(frag->page), scratch, len);

frag->page_offset = 0;
frag->size = len;
memcpy(skb_frag_address(frag), scratch, len);

skb->truesize += len;
skb->data_len += len;
skb->len += len;
Expand Down

0 comments on commit 084b372

Please sign in to comment.