Skip to content

Commit

Permalink
[IPSEC]: Fix scatterlist handling in skb_icv_walk().
Browse files Browse the repository at this point in the history
Use sg_init_one() and sg_init_table() as needed.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
David S. Miller committed Oct 26, 2007
1 parent ed0e7e0 commit 0e0940d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/xfrm/xfrm_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > len)
copy = len;

sg_set_buf(&sg, skb->data + offset, copy);
sg_init_one(&sg, skb->data + offset, copy);

err = icv_update(desc, &sg, copy);
if (unlikely(err))
Expand All @@ -576,8 +576,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > len)
copy = len;

sg_init_table(&sg, 1);
sg_set_page(&sg, frag->page, copy,
frag->page_offset + offset-start);
frag->page_offset + offset-start);

err = icv_update(desc, &sg, copy);
if (unlikely(err))
Expand Down

0 comments on commit 0e0940d

Please sign in to comment.