|
@@ -599,18 +599,18 @@ int ping_getfrag(void *from, char *to,
|
|
|
struct pingfakehdr *pfh = (struct pingfakehdr *)from;
|
|
|
|
|
|
if (offset == 0) {
|
|
|
- if (fraglen < sizeof(struct icmphdr))
|
|
|
+ fraglen -= sizeof(struct icmphdr);
|
|
|
+ if (fraglen < 0)
|
|
|
BUG();
|
|
|
- if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr),
|
|
|
- pfh->msg->msg_iter.iov, 0, fraglen - sizeof(struct icmphdr),
|
|
|
- &pfh->wcheck))
|
|
|
+ if (csum_and_copy_from_iter(to + sizeof(struct icmphdr),
|
|
|
+ fraglen, &pfh->wcheck,
|
|
|
+ &pfh->msg->msg_iter) != fraglen)
|
|
|
return -EFAULT;
|
|
|
} else if (offset < sizeof(struct icmphdr)) {
|
|
|
BUG();
|
|
|
} else {
|
|
|
- if (csum_partial_copy_fromiovecend
|
|
|
- (to, pfh->msg->msg_iter.iov, offset - sizeof(struct icmphdr),
|
|
|
- fraglen, &pfh->wcheck))
|
|
|
+ if (csum_and_copy_from_iter(to, fraglen, &pfh->wcheck,
|
|
|
+ &pfh->msg->msg_iter) != fraglen)
|
|
|
return -EFAULT;
|
|
|
}
|
|
|
|