summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorsuz <suz@FreeBSD.org>2004-04-01 13:48:23 +0000
committersuz <suz@FreeBSD.org>2004-04-01 13:48:23 +0000
commitd55178321122c344c353bb17a661cc40609f8d73 (patch)
treea84c8c7fa5f177dbab865c215141d7ed8f88a9a4 /sys/netinet6
parent5b8456cb6f4a5c05036f4569afe00c8ede26e043 (diff)
downloadFreeBSD-src-d55178321122c344c353bb17a661cc40609f8d73.zip
FreeBSD-src-d55178321122c344c353bb17a661cc40609f8d73.tar.gz
UDP checksum is mandatory in IPv6 (RFC2460 p.28)
Obtained from: KAME
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/udp6_usrreq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 4ab9b35..25bad0f 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -168,9 +168,11 @@ udp6_input(mp, offp, proto)
/*
* Checksum extended UDP header and data.
*/
- if (uh->uh_sum == 0)
+ if (uh->uh_sum == 0) {
udpstat.udps_nosum++;
- else if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) {
+ goto bad;
+ }
+ if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) {
udpstat.udps_badsum++;
goto bad;
}
OpenPOWER on IntegriCloud