diff options
| author | Rygebin <kaankulahli@gmail.com> | 2017-06-20 14:29:27 +0000 |
|---|---|---|
| committer | Rygebin <kaankulahli@gmail.com> | 2017-06-20 14:29:27 +0000 |
| commit | afa9ad70f02491fbe10df2203f8f2fa42f956228 (patch) | |
| tree | b6dce4ed04f62fd443721a94ac3e7f81427e0ad1 /net/ipv6/udp.c | |
| parent | 582eb92a1e8bf6c0e743774c1fb550e630715433 (diff) | |
| parent | 08d1ec9238c605a9a5cf1229fd60961efcd21ff1 (diff) | |
Diffstat (limited to 'net/ipv6/udp.c')
| -rw-r--r-- | net/ipv6/udp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 25f3babd59d..0f22ad1e847 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -370,6 +370,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, int peeked, off = 0; int err; int is_udplite = IS_UDPLITE(sk); + bool checksum_valid = false; int is_udp4; bool slow; @@ -401,11 +402,12 @@ try_again: */ if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) { - if (udp_lib_checksum_complete(skb)) + checksum_valid = !udp_lib_checksum_complete(skb); + if (!checksum_valid) goto csum_copy_err; } - if (skb_csum_unnecessary(skb)) + if (checksum_valid || skb_csum_unnecessary(skb)) err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov, copied); else { |
