aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/tcp_ipv6.c3
-rw-r--r--net/ipv6/udp.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 2b3be68b70a7..f65fcd7704ca 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -368,7 +368,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
368 skb->len, inet->num, skb->csum)) 368 skb->len, inet->num, skb->csum))
369 skb->ip_summed = CHECKSUM_UNNECESSARY; 369 skb->ip_summed = CHECKSUM_UNNECESSARY;
370 } 370 }
371 if (skb->ip_summed != CHECKSUM_UNNECESSARY) 371 if (!skb_csum_unnecessary(skb))
372 skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 372 skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
373 &ipv6_hdr(skb)->daddr, 373 &ipv6_hdr(skb)->daddr,
374 skb->len, 374 skb->len,
@@ -421,7 +421,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
421 msg->msg_flags |= MSG_TRUNC; 421 msg->msg_flags |= MSG_TRUNC;
422 } 422 }
423 423
424 if (skb->ip_summed==CHECKSUM_UNNECESSARY) { 424 if (skb_csum_unnecessary(skb)) {
425 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 425 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
426 } else if (msg->msg_flags&MSG_TRUNC) { 426 } else if (msg->msg_flags&MSG_TRUNC) {
427 if (__skb_checksum_complete(skb)) 427 if (__skb_checksum_complete(skb))
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7e824b97126d..2b668a6ae698 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1707,8 +1707,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb)
1707 if (!pskb_may_pull(skb, th->doff*4)) 1707 if (!pskb_may_pull(skb, th->doff*4))
1708 goto discard_it; 1708 goto discard_it;
1709 1709
1710 if ((skb->ip_summed != CHECKSUM_UNNECESSARY && 1710 if (!skb_csum_unnecessary(skb) && tcp_v6_checksum_init(skb))
1711 tcp_v6_checksum_init(skb)))
1712 goto bad_packet; 1711 goto bad_packet;
1713 1712
1714 th = tcp_hdr(skb); 1713 th = tcp_hdr(skb);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 1e3dfb20b1cf..b083c09e3d2d 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -153,7 +153,7 @@ try_again:
153 goto csum_copy_err; 153 goto csum_copy_err;
154 } 154 }
155 155
156 if (skb->ip_summed == CHECKSUM_UNNECESSARY) 156 if (skb_csum_unnecessary(skb))
157 err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), 157 err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
158 msg->msg_iov, copied ); 158 msg->msg_iov, copied );
159 else { 159 else {
@@ -397,7 +397,7 @@ static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh,
397 skb->len, proto, skb->csum)) 397 skb->len, proto, skb->csum))
398 skb->ip_summed = CHECKSUM_UNNECESSARY; 398 skb->ip_summed = CHECKSUM_UNNECESSARY;
399 399
400 if (skb->ip_summed != CHECKSUM_UNNECESSARY) 400 if (!skb_csum_unnecessary(skb))
401 skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 401 skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
402 &ipv6_hdr(skb)->daddr, 402 &ipv6_hdr(skb)->daddr,
403 skb->len, proto, 0)); 403 skb->len, proto, 0));