appletalk: Use frag list abstraction interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
a5bd8a13e9
Коммит
c32ba3f9b8
|
@ -939,6 +939,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
|
||||||
int len, unsigned long sum)
|
int len, unsigned long sum)
|
||||||
{
|
{
|
||||||
int start = skb_headlen(skb);
|
int start = skb_headlen(skb);
|
||||||
|
struct sk_buff *frag_iter;
|
||||||
int i, copy;
|
int i, copy;
|
||||||
|
|
||||||
/* checksum stuff in header space */
|
/* checksum stuff in header space */
|
||||||
|
@ -977,26 +978,22 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
|
||||||
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;
|
int end;
|
||||||
|
|
||||||
for (; list; list = list->next) {
|
WARN_ON(start > offset + len);
|
||||||
int end;
|
|
||||||
|
|
||||||
WARN_ON(start > offset + len);
|
end = start + frag_iter->len;
|
||||||
|
if ((copy = end - offset) > 0) {
|
||||||
end = start + list->len;
|
if (copy > len)
|
||||||
if ((copy = end - offset) > 0) {
|
copy = len;
|
||||||
if (copy > len)
|
sum = atalk_sum_skb(frag_iter, offset - start,
|
||||||
copy = len;
|
copy, sum);
|
||||||
sum = atalk_sum_skb(list, offset - start,
|
if ((len -= copy) == 0)
|
||||||
copy, sum);
|
return sum;
|
||||||
if ((len -= copy) == 0)
|
offset += copy;
|
||||||
return sum;
|
|
||||||
offset += copy;
|
|
||||||
}
|
|
||||||
start = end;
|
|
||||||
}
|
}
|
||||||
|
start = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
BUG_ON(len > 0);
|
BUG_ON(len > 0);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче