UDP checksum is mandatory in IPv6 (RFC2460 p.28)

Obtained from: KAME
This commit is contained in:
suz 2004-04-01 13:48:23 +00:00
parent 5b8456cb6f
commit d551783211

View File

@ -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;
}