Commit d4fd3bc1 authored by David S. Miller's avatar David S. Miller

xfrm: Use frag list abstraction interfaces.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b003be3
...@@ -696,8 +696,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, ...@@ -696,8 +696,9 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
{ {
int start = skb_headlen(skb); int start = skb_headlen(skb);
int i, copy = start - offset; int i, copy = start - offset;
int err; struct sk_buff *frag_iter;
struct scatterlist sg; struct scatterlist sg;
int err;
/* Checksum header. */ /* Checksum header. */
if (copy > 0) { if (copy > 0) {
...@@ -742,19 +743,16 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, ...@@ -742,19 +743,16 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
start = end; start = end;
} }
if (skb_shinfo(skb)->frag_list) { skb_walk_frags(skb, frag_iter) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;
for (; list; list = list->next) {
int end; int end;
WARN_ON(start > offset + len); WARN_ON(start > offset + len);
end = start + list->len; end = start + frag_iter->len;
if ((copy = end - offset) > 0) { if ((copy = end - offset) > 0) {
if (copy > len) if (copy > len)
copy = len; copy = len;
err = skb_icv_walk(list, desc, offset-start, err = skb_icv_walk(frag_iter, desc, offset-start,
copy, icv_update); copy, icv_update);
if (unlikely(err)) if (unlikely(err))
return err; return err;
...@@ -764,7 +762,6 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, ...@@ -764,7 +762,6 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
} }
start = end; start = end;
} }
}
BUG_ON(len); BUG_ON(len);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment