summaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_algo.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/xfrm/xfrm_algo.c')
-rw-r--r--net/xfrm/xfrm_algo.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 313d4bed3aa9..0426388d351d 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -553,9 +553,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > len)
copy = len;
- sg_set_page(&sg, virt_to_page(skb->data + offset));
- sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
- sg.length = copy;
+ sg_init_one(&sg, skb->data + offset, copy);
err = icv_update(desc, &sg, copy);
if (unlikely(err))
@@ -578,9 +576,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > len)
copy = len;
- sg_set_page(&sg, frag->page);
- sg.offset = frag->page_offset + offset-start;
- sg.length = copy;
+ sg_init_table(&sg, 1);
+ sg_set_page(&sg, frag->page, copy,
+ frag->page_offset + offset-start);
err = icv_update(desc, &sg, copy);
if (unlikely(err))