diff options
author | Tom Herbert <therbert@google.com> | 2014-05-07 23:52:39 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-09 03:47:50 (GMT) |
commit | 0a80966b1043c3e2dc684140f155a3fded308660 (patch) | |
tree | 9f8742c79ed1c3bf8f79eee1c46ea4c073fc80a5 /net/ipv6 | |
parent | 39471ac8dde690bf944248e06bec32a4568cdd45 (diff) | |
download | linux-0a80966b1043c3e2dc684140f155a3fded308660.tar.xz |
net: Verify UDP checksum before handoff to encap
Moving validation of UDP checksum to be done in UDP not encap layer.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/udp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index fc2be63..7edf096 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -634,6 +634,10 @@ int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) if (skb->len > sizeof(struct udphdr) && encap_rcv != NULL) { int ret; + /* Verify checksum before giving to encap */ + if (udp_lib_checksum_complete(skb)) + goto csum_error; + ret = encap_rcv(sk, skb); if (ret <= 0) { UDP_INC_STATS_BH(sock_net(sk), |