UPD and UDPLite require a checksum. So check for it.

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2014-10-03 08:46:49 +00:00
parent d17183901f
commit 4e1730b532

View File

@ -237,11 +237,19 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
/* XXX: What is the right UDPLite MIB counter? */
goto badunlocked;
}
if (uh->uh_sum == 0) {
/* XXX: What is the right UDPLite MIB counter? */
goto badunlocked;
}
} else {
if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) {
UDPSTAT_INC(udps_badlen);
goto badunlocked;
}
if (uh->uh_sum == 0) {
UDPSTAT_INC(udps_nosum);
goto badunlocked;
}
}
if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) &&