diff options
-rw-r--r-- | include/net/checksum.h | 2 | ||||
-rw-r--r-- | include/net/ip_vs.h | 6 | ||||
-rw-r--r-- | net/core/netpoll.c | 2 | ||||
-rw-r--r-- | net/ipv4/inet_lro.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv6/icmp.c | 4 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 2 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 4 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 | ||||
-rw-r--r-- | net/unix/af_unix.c | 4 |
10 files changed, 19 insertions, 19 deletions
diff --git a/include/net/checksum.h b/include/net/checksum.h index 07602b7fa218..ba55d8b8c87c 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
@@ -98,7 +98,7 @@ static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) | |||
98 | { | 98 | { |
99 | __be32 diff[] = { ~from, to }; | 99 | __be32 diff[] = { ~from, to }; |
100 | 100 | ||
101 | *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); | 101 | *sum = csum_fold(csum_partial(diff, sizeof(diff), ~csum_unfold(*sum))); |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to) | 104 | static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to) |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 8f6abf4883e3..ab9b003ab671 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -913,7 +913,7 @@ static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) | |||
913 | { | 913 | { |
914 | __be32 diff[2] = { ~old, new }; | 914 | __be32 diff[2] = { ~old, new }; |
915 | 915 | ||
916 | return csum_partial((char *) diff, sizeof(diff), oldsum); | 916 | return csum_partial(diff, sizeof(diff), oldsum); |
917 | } | 917 | } |
918 | 918 | ||
919 | #ifdef CONFIG_IP_VS_IPV6 | 919 | #ifdef CONFIG_IP_VS_IPV6 |
@@ -923,7 +923,7 @@ static inline __wsum ip_vs_check_diff16(const __be32 *old, const __be32 *new, | |||
923 | __be32 diff[8] = { ~old[3], ~old[2], ~old[1], ~old[0], | 923 | __be32 diff[8] = { ~old[3], ~old[2], ~old[1], ~old[0], |
924 | new[3], new[2], new[1], new[0] }; | 924 | new[3], new[2], new[1], new[0] }; |
925 | 925 | ||
926 | return csum_partial((char *) diff, sizeof(diff), oldsum); | 926 | return csum_partial(diff, sizeof(diff), oldsum); |
927 | } | 927 | } |
928 | #endif | 928 | #endif |
929 | 929 | ||
@@ -931,7 +931,7 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) | |||
931 | { | 931 | { |
932 | __be16 diff[2] = { ~old, new }; | 932 | __be16 diff[2] = { ~old, new }; |
933 | 933 | ||
934 | return csum_partial((char *) diff, sizeof(diff), oldsum); | 934 | return csum_partial(diff, sizeof(diff), oldsum); |
935 | } | 935 | } |
936 | 936 | ||
937 | #endif /* __KERNEL__ */ | 937 | #endif /* __KERNEL__ */ |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 34f5d072f168..fc4e28e23b89 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -343,7 +343,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
343 | udph->check = csum_tcpudp_magic(htonl(np->local_ip), | 343 | udph->check = csum_tcpudp_magic(htonl(np->local_ip), |
344 | htonl(np->remote_ip), | 344 | htonl(np->remote_ip), |
345 | udp_len, IPPROTO_UDP, | 345 | udp_len, IPPROTO_UDP, |
346 | csum_partial((unsigned char *)udph, udp_len, 0)); | 346 | csum_partial(udph, udp_len, 0)); |
347 | if (udph->check == 0) | 347 | if (udph->check == 0) |
348 | udph->check = CSUM_MANGLED_0; | 348 | udph->check = CSUM_MANGLED_0; |
349 | 349 | ||
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index cfd034a2b96e..6a667dae315e 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c | |||
@@ -120,7 +120,7 @@ static void lro_update_tcp_ip_header(struct net_lro_desc *lro_desc) | |||
120 | iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl); | 120 | iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl); |
121 | 121 | ||
122 | tcph->check = 0; | 122 | tcph->check = 0; |
123 | tcp_hdr_csum = csum_partial((u8 *)tcph, TCP_HDR_LEN(tcph), 0); | 123 | tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), 0); |
124 | lro_desc->data_csum = csum_add(lro_desc->data_csum, tcp_hdr_csum); | 124 | lro_desc->data_csum = csum_add(lro_desc->data_csum, tcp_hdr_csum); |
125 | tcph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, | 125 | tcph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, |
126 | lro_desc->ip_tot_len - | 126 | lro_desc->ip_tot_len - |
@@ -135,7 +135,7 @@ static __wsum lro_tcp_data_csum(struct iphdr *iph, struct tcphdr *tcph, int len) | |||
135 | __wsum tcp_ps_hdr_csum; | 135 | __wsum tcp_ps_hdr_csum; |
136 | 136 | ||
137 | tcp_csum = ~csum_unfold(tcph->check); | 137 | tcp_csum = ~csum_unfold(tcph->check); |
138 | tcp_hdr_csum = csum_partial((u8 *)tcph, TCP_HDR_LEN(tcph), tcp_csum); | 138 | tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), tcp_csum); |
139 | 139 | ||
140 | tcp_ps_hdr_csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, | 140 | tcp_ps_hdr_csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, |
141 | len + TCP_HDR_LEN(tcph), | 141 | len + TCP_HDR_LEN(tcph), |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index b2e3ab2287ba..5559fea61e87 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -492,7 +492,7 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
492 | skb->csum_offset = offsetof(struct tcphdr, check); | 492 | skb->csum_offset = offsetof(struct tcphdr, check); |
493 | } else { | 493 | } else { |
494 | th->check = tcp_v4_check(len, inet->saddr, inet->daddr, | 494 | th->check = tcp_v4_check(len, inet->saddr, inet->daddr, |
495 | csum_partial((char *)th, | 495 | csum_partial(th, |
496 | th->doff << 2, | 496 | th->doff << 2, |
497 | skb->csum)); | 497 | skb->csum)); |
498 | } | 498 | } |
@@ -726,7 +726,7 @@ static int __tcp_v4_send_synack(struct sock *sk, struct request_sock *req, | |||
726 | th->check = tcp_v4_check(skb->len, | 726 | th->check = tcp_v4_check(skb->len, |
727 | ireq->loc_addr, | 727 | ireq->loc_addr, |
728 | ireq->rmt_addr, | 728 | ireq->rmt_addr, |
729 | csum_partial((char *)th, skb->len, | 729 | csum_partial(th, skb->len, |
730 | skb->csum)); | 730 | skb->csum)); |
731 | 731 | ||
732 | err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, | 732 | err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index be351009fd03..a77b8d103804 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -233,7 +233,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct | |||
233 | icmp6h->icmp6_cksum = 0; | 233 | icmp6h->icmp6_cksum = 0; |
234 | 234 | ||
235 | if (skb_queue_len(&sk->sk_write_queue) == 1) { | 235 | if (skb_queue_len(&sk->sk_write_queue) == 1) { |
236 | skb->csum = csum_partial((char *)icmp6h, | 236 | skb->csum = csum_partial(icmp6h, |
237 | sizeof(struct icmp6hdr), skb->csum); | 237 | sizeof(struct icmp6hdr), skb->csum); |
238 | icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, | 238 | icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, |
239 | &fl->fl6_dst, | 239 | &fl->fl6_dst, |
@@ -246,7 +246,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct | |||
246 | tmp_csum = csum_add(tmp_csum, skb->csum); | 246 | tmp_csum = csum_add(tmp_csum, skb->csum); |
247 | } | 247 | } |
248 | 248 | ||
249 | tmp_csum = csum_partial((char *)icmp6h, | 249 | tmp_csum = csum_partial(icmp6h, |
250 | sizeof(struct icmp6hdr), tmp_csum); | 250 | sizeof(struct icmp6hdr), tmp_csum); |
251 | icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, | 251 | icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, |
252 | &fl->fl6_dst, | 252 | &fl->fl6_dst, |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index a76199ecad23..870a1d64605a 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1817,7 +1817,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1817 | 1817 | ||
1818 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, | 1818 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, |
1819 | IPPROTO_ICMPV6, | 1819 | IPPROTO_ICMPV6, |
1820 | csum_partial((__u8 *) hdr, len, 0)); | 1820 | csum_partial(hdr, len, 0)); |
1821 | 1821 | ||
1822 | idev = in6_dev_get(skb->dev); | 1822 | idev = in6_dev_get(skb->dev); |
1823 | 1823 | ||
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index fbf451c0d77a..af6705f03b5c 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -491,7 +491,7 @@ struct sk_buff *ndisc_build_skb(struct net_device *dev, | |||
491 | 491 | ||
492 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len, | 492 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len, |
493 | IPPROTO_ICMPV6, | 493 | IPPROTO_ICMPV6, |
494 | csum_partial((__u8 *) hdr, | 494 | csum_partial(hdr, |
495 | len, 0)); | 495 | len, 0)); |
496 | 496 | ||
497 | return skb; | 497 | return skb; |
@@ -1612,7 +1612,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
1612 | 1612 | ||
1613 | icmph->icmp6_cksum = csum_ipv6_magic(&saddr_buf, &ipv6_hdr(skb)->saddr, | 1613 | icmph->icmp6_cksum = csum_ipv6_magic(&saddr_buf, &ipv6_hdr(skb)->saddr, |
1614 | len, IPPROTO_ICMPV6, | 1614 | len, IPPROTO_ICMPV6, |
1615 | csum_partial((u8 *) icmph, len, 0)); | 1615 | csum_partial(icmph, len, 0)); |
1616 | 1616 | ||
1617 | buff->dst = dst; | 1617 | buff->dst = dst; |
1618 | idev = in6_dev_get(dst->dev); | 1618 | idev = in6_dev_get(dst->dev); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index b35787056313..a5d750acd793 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -501,7 +501,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req) | |||
501 | 501 | ||
502 | th->check = tcp_v6_check(th, skb->len, | 502 | th->check = tcp_v6_check(th, skb->len, |
503 | &treq->loc_addr, &treq->rmt_addr, | 503 | &treq->loc_addr, &treq->rmt_addr, |
504 | csum_partial((char *)th, skb->len, skb->csum)); | 504 | csum_partial(th, skb->len, skb->csum)); |
505 | 505 | ||
506 | ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr); | 506 | ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr); |
507 | err = ip6_xmit(sk, skb, &fl, opt, 0); | 507 | err = ip6_xmit(sk, skb, &fl, opt, 0); |
@@ -915,7 +915,7 @@ static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
915 | skb->csum_offset = offsetof(struct tcphdr, check); | 915 | skb->csum_offset = offsetof(struct tcphdr, check); |
916 | } else { | 916 | } else { |
917 | th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, | 917 | th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, |
918 | csum_partial((char *)th, th->doff<<2, | 918 | csum_partial(th, th->doff<<2, |
919 | skb->csum)); | 919 | skb->csum)); |
920 | } | 920 | } |
921 | } | 921 | } |
@@ -997,7 +997,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
997 | } | 997 | } |
998 | #endif | 998 | #endif |
999 | 999 | ||
1000 | buff->csum = csum_partial((char *)t1, tot_len, 0); | 1000 | buff->csum = csum_partial(t1, tot_len, 0); |
1001 | 1001 | ||
1002 | memset(&fl, 0, sizeof(fl)); | 1002 | memset(&fl, 0, sizeof(fl)); |
1003 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); | 1003 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index f2cf3f583f62..ebc4a9a4b1f7 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -216,7 +216,7 @@ static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned *hashp) | |||
216 | return len; | 216 | return len; |
217 | } | 217 | } |
218 | 218 | ||
219 | *hashp = unix_hash_fold(csum_partial((char *)sunaddr, len, 0)); | 219 | *hashp = unix_hash_fold(csum_partial(sunaddr, len, 0)); |
220 | return len; | 220 | return len; |
221 | } | 221 | } |
222 | 222 | ||
@@ -686,7 +686,7 @@ static int unix_autobind(struct socket *sock) | |||
686 | 686 | ||
687 | retry: | 687 | retry: |
688 | addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short); | 688 | addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short); |
689 | addr->hash = unix_hash_fold(csum_partial((void *)addr->name, addr->len, 0)); | 689 | addr->hash = unix_hash_fold(csum_partial(addr->name, addr->len, 0)); |
690 | 690 | ||
691 | spin_lock(&unix_table_lock); | 691 | spin_lock(&unix_table_lock); |
692 | ordernum = (ordernum+1)&0xFFFFF; | 692 | ordernum = (ordernum+1)&0xFFFFF; |