浏览代码

[IPSEC]: Fix scatterlist handling in skb_icv_walk().

Use sg_init_one() and sg_init_table() as needed.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 17 年之前
父节点
当前提交
0e0940d4bb
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      net/xfrm/xfrm_algo.c

+ 3 - 2
net/xfrm/xfrm_algo.c

@@ -553,7 +553,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
 		if (copy > len)
 		if (copy > len)
 			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);
 		err = icv_update(desc, &sg, copy);
 		if (unlikely(err))
 		if (unlikely(err))
@@ -576,8 +576,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
 			if (copy > len)
 			if (copy > len)
 				copy = len;
 				copy = len;
 
 
+			sg_init_table(&sg, 1);
 			sg_set_page(&sg, frag->page, copy,
 			sg_set_page(&sg, frag->page, copy,
-					frag->page_offset + offset-start);
+				    frag->page_offset + offset-start);
 
 
 			err = icv_update(desc, &sg, copy);
 			err = icv_update(desc, &sg, copy);
 			if (unlikely(err))
 			if (unlikely(err))