diff options
-rw-r--r-- | include/linux/skbuff.h | 3 | ||||
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | net/core/datagram.c | 6 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e3ae544b3956..64fa7f4c702d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1199,8 +1199,7 @@ static inline int skb_add_data(struct sk_buff *skb, | |||
1199 | 1199 | ||
1200 | if (skb->ip_summed == CHECKSUM_NONE) { | 1200 | if (skb->ip_summed == CHECKSUM_NONE) { |
1201 | int err = 0; | 1201 | int err = 0; |
1202 | unsigned int csum = csum_and_copy_from_user(from, | 1202 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), |
1203 | skb_put(skb, copy), | ||
1204 | copy, 0, &err); | 1203 | copy, 0, &err); |
1205 | if (!err) { | 1204 | if (!err) { |
1206 | skb->csum = csum_block_add(skb->csum, csum, off); | 1205 | skb->csum = csum_block_add(skb->csum, csum, off); |
diff --git a/include/net/sock.h b/include/net/sock.h index 35ffbdd35d3e..dc4b92b8abea 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1088,7 +1088,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from, | |||
1088 | { | 1088 | { |
1089 | if (skb->ip_summed == CHECKSUM_NONE) { | 1089 | if (skb->ip_summed == CHECKSUM_NONE) { |
1090 | int err = 0; | 1090 | int err = 0; |
1091 | unsigned int csum = csum_and_copy_from_user(from, | 1091 | __wsum csum = csum_and_copy_from_user(from, |
1092 | page_address(page) + off, | 1092 | page_address(page) + off, |
1093 | copy, 0, &err); | 1093 | copy, 0, &err); |
1094 | if (err) | 1094 | if (err) |
diff --git a/net/core/datagram.c b/net/core/datagram.c index e5a05a046fef..0d9c9bac4006 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
@@ -321,7 +321,7 @@ fault: | |||
321 | 321 | ||
322 | static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, | 322 | static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, |
323 | u8 __user *to, int len, | 323 | u8 __user *to, int len, |
324 | unsigned int *csump) | 324 | __wsum *csump) |
325 | { | 325 | { |
326 | int start = skb_headlen(skb); | 326 | int start = skb_headlen(skb); |
327 | int pos = 0; | 327 | int pos = 0; |
@@ -350,7 +350,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, | |||
350 | 350 | ||
351 | end = start + skb_shinfo(skb)->frags[i].size; | 351 | end = start + skb_shinfo(skb)->frags[i].size; |
352 | if ((copy = end - offset) > 0) { | 352 | if ((copy = end - offset) > 0) { |
353 | unsigned int csum2; | 353 | __wsum csum2; |
354 | int err = 0; | 354 | int err = 0; |
355 | u8 *vaddr; | 355 | u8 *vaddr; |
356 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 356 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
@@ -386,7 +386,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, | |||
386 | 386 | ||
387 | end = start + list->len; | 387 | end = start + list->len; |
388 | if ((copy = end - offset) > 0) { | 388 | if ((copy = end - offset) > 0) { |
389 | unsigned int csum2 = 0; | 389 | __wsum csum2 = 0; |
390 | if (copy > len) | 390 | if (copy > len) |
391 | copy = len; | 391 | copy = len; |
392 | if (skb_copy_and_csum_datagram(list, | 392 | if (skb_copy_and_csum_datagram(list, |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c0e3427057fc..da6683f4b31d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1342,7 +1342,7 @@ unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, | |||
1342 | 1342 | ||
1343 | end = start + skb_shinfo(skb)->frags[i].size; | 1343 | end = start + skb_shinfo(skb)->frags[i].size; |
1344 | if ((copy = end - offset) > 0) { | 1344 | if ((copy = end - offset) > 0) { |
1345 | unsigned int csum2; | 1345 | __wsum csum2; |
1346 | u8 *vaddr; | 1346 | u8 *vaddr; |
1347 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 1347 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
1348 | 1348 | ||
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index f9194f7e39d3..1da3d32f8289 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1314,7 +1314,7 @@ void ip_flush_pending_frames(struct sock *sk) | |||
1314 | static int ip_reply_glue_bits(void *dptr, char *to, int offset, | 1314 | static int ip_reply_glue_bits(void *dptr, char *to, int offset, |
1315 | int len, int odd, struct sk_buff *skb) | 1315 | int len, int odd, struct sk_buff *skb) |
1316 | { | 1316 | { |
1317 | unsigned int csum; | 1317 | __wsum csum; |
1318 | 1318 | ||
1319 | csum = csum_partial_copy_nocheck(dptr+offset, to, len, 0); | 1319 | csum = csum_partial_copy_nocheck(dptr+offset, to, len, 0); |
1320 | skb->csum = csum_block_add(skb->csum, csum, odd); | 1320 | skb->csum = csum_block_add(skb->csum, csum, odd); |