1
2
3
4
5
6
7#include <linux/module.h>
8#include <net/checksum.h>
9
10#include <asm/byteorder.h>
11
12
13
14
15__wsum
16csum_partial_copy_from_user(const void __user *src, void *dst, int len,
17 __wsum sum, int *csum_err)
18{
19 int missing;
20
21 missing = __copy_from_user(dst, src, len);
22 if (missing) {
23 memset(dst + len - missing, 0, missing);
24 *csum_err = -EFAULT;
25 } else
26 *csum_err = 0;
27
28 return csum_partial(dst, len, sum);
29}
30EXPORT_SYMBOL(csum_partial_copy_from_user);
31
32
33EXPORT_SYMBOL(csum_partial);
34EXPORT_SYMBOL(csum_partial_copy);
35EXPORT_SYMBOL(ip_compute_csum);
36EXPORT_SYMBOL(ip_fast_csum);
37