net: xfrm: convert to SKB frag APIs
authorIan Campbell <Ian.Campbell@citrix.com>
Mon, 22 Aug 2011 23:45:01 +0000 (23:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Aug 2011 00:52:12 +0000 (17:52 -0700)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_ipcomp.c

index fc91ad7ee26e7e8baa9b3f9f3b332425c55e5427..f781b9ab8a54f693815e0f3338715734e9d21644 100644 (file)
@@ -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;