.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * INET An implementation of the TCP/IP protocol suite for the LINUX |
---|
3 | 4 | * operating system. INET is implemented using the BSD Socket |
---|
.. | .. |
---|
8 | 9 | * Authors: Ralf Baechle, <ralf@waldorf-gmbh.de> |
---|
9 | 10 | * Lots of code moved from tcp.c and ip.c; see those files |
---|
10 | 11 | * for more names. |
---|
11 | | - * |
---|
12 | | - * This program is free software; you can redistribute it and/or |
---|
13 | | - * modify it under the terms of the GNU General Public License |
---|
14 | | - * as published by the Free Software Foundation; either version |
---|
15 | | - * 2 of the License, or (at your option) any later version. |
---|
16 | 12 | */ |
---|
17 | 13 | #include <linux/module.h> |
---|
18 | 14 | #include <linux/types.h> |
---|
.. | .. |
---|
110 | 106 | } |
---|
111 | 107 | |
---|
112 | 108 | EXPORT_SYMBOL(csum_partial); |
---|
113 | | - |
---|
114 | | -/* |
---|
115 | | - * copy while checksumming, otherwise like csum_partial |
---|
116 | | - */ |
---|
117 | | -__wsum csum_partial_copy_nocheck(const void *src, void *dst, |
---|
118 | | - int len, __wsum sum) |
---|
119 | | -{ |
---|
120 | | - /* |
---|
121 | | - * It's 2:30 am and I don't feel like doing it real ... |
---|
122 | | - * This is lots slower than the real thing (tm) |
---|
123 | | - */ |
---|
124 | | - sum = csum_partial(src, len, sum); |
---|
125 | | - memcpy(dst, src, len); |
---|
126 | | - |
---|
127 | | - return sum; |
---|
128 | | -} |
---|
129 | | -EXPORT_SYMBOL(csum_partial_copy_nocheck); |
---|
130 | | - |
---|
131 | | -/* |
---|
132 | | - * Copy from userspace and compute checksum. If we catch an exception |
---|
133 | | - * then zero the rest of the buffer. |
---|
134 | | - */ |
---|
135 | | -__wsum csum_partial_copy_from_user(const void __user *src, |
---|
136 | | - void *dst, int len, |
---|
137 | | - __wsum sum, int *err_ptr) |
---|
138 | | -{ |
---|
139 | | - int missing; |
---|
140 | | - |
---|
141 | | - missing = copy_from_user(dst, src, len); |
---|
142 | | - if (missing) { |
---|
143 | | - memset(dst + len - missing, 0, missing); |
---|
144 | | - *err_ptr = -EFAULT; |
---|
145 | | - } |
---|
146 | | - |
---|
147 | | - return csum_partial(dst, len, sum); |
---|
148 | | -} |
---|
149 | | -EXPORT_SYMBOL(csum_partial_copy_from_user); |
---|