summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-06-09 00:22:47 -0700
committerDavid S. Miller <davem@davemloft.net>2009-06-09 00:24:07 -0700
commitd4fd3bc101909802f9ed083093cce688cc3416aa (patch)
tree5b69ca6437f871ae581ae7b7ca3e9149615b7486 /net/xfrm
parent1b003be39e91a6cd013c9ea580ccc24d1fac9959 (diff)
downloadlinux-3.10-d4fd3bc101909802f9ed083093cce688cc3416aa.tar.gz
linux-3.10-d4fd3bc101909802f9ed083093cce688cc3416aa.tar.bz2
linux-3.10-d4fd3bc101909802f9ed083093cce688cc3416aa.zip
xfrm: Use frag list abstraction interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_algo.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 96036cf2216..d31ccb48773 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -696,8 +696,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
{
int start = skb_headlen(skb);
int i, copy = start - offset;
- int err;
+ struct sk_buff *frag_iter;
struct scatterlist sg;
+ int err;
/* Checksum header. */
if (copy > 0) {
@@ -742,28 +743,24 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
start = end;
}
- if (skb_shinfo(skb)->frag_list) {
- struct sk_buff *list = skb_shinfo(skb)->frag_list;
-
- for (; list; list = list->next) {
- int end;
-
- WARN_ON(start > offset + len);
-
- end = start + list->len;
- if ((copy = end - offset) > 0) {
- if (copy > len)
- copy = len;
- err = skb_icv_walk(list, desc, offset-start,
- copy, icv_update);
- if (unlikely(err))
- return err;
- if ((len -= copy) == 0)
- return 0;
- offset += copy;
- }
- start = end;
+ skb_walk_frags(skb, frag_iter) {
+ int end;
+
+ WARN_ON(start > offset + len);
+
+ end = start + frag_iter->len;
+ if ((copy = end - offset) > 0) {
+ if (copy > len)
+ copy = len;
+ err = skb_icv_walk(frag_iter, desc, offset-start,
+ copy, icv_update);
+ if (unlikely(err))
+ return err;
+ if ((len -= copy) == 0)
+ return 0;
+ offset += copy;
}
+ start = end;
}
BUG_ON(len);
return 0;