diff options
author | popcornmix <popcornmix@gmail.com> | 2016-09-15 13:20:44 +0100 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2016-09-15 13:20:44 +0100 |
commit | 2d31cd571e6f2ac61a3eda273d973058e1bb1f58 (patch) | |
tree | 640893fdb9ce69915cde3f189cff835ce4d6c3fa /net/ipv6/udp.c | |
parent | 24e62728b3fc4f118c8ae17b374bce189bb188fc (diff) | |
parent | 1d074db69c46d62ce82b331c2080e2fcb710bf4a (diff) |
Merge remote-tracking branch 'stable/linux-4.4.y' into rpi-4.4.yraspberrypi-kernel_1.20160921-1
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 275af43306f9..e6092bd72ee2 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -402,6 +402,7 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int peeked, off = 0; int err; int is_udplite = IS_UDPLITE(sk); + bool checksum_valid = false; int is_udp4; bool slow; @@ -433,11 +434,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_msg(skb, sizeof(struct udphdr), msg, copied); else { |