If the checksum coverage field in the UDPLITE header is the length

of the complete UDPLITE packet, the packet has full checksum coverage.
SO fix the condition.

Reviewed by: kevlo
MFC after: 3 days
This commit is contained in:
Michael Tuexen 2014-09-30 18:17:28 +00:00
parent 59adbba20f
commit 0f4a03663b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272323
2 changed files with 6 additions and 4 deletions

View File

@ -444,9 +444,10 @@ udp_input(struct mbuf **mp, int *offp, int proto)
*/
len = ntohs((u_short)uh->uh_ulen);
ip_len = ntohs(ip->ip_len) - iphlen;
if (proto == IPPROTO_UDPLITE && len == 0) {
if (proto == IPPROTO_UDPLITE && (len == 0 || len == ip_len)) {
/* Zero means checksum over the complete packet. */
len = ip_len;
if (len == 0)
len = ip_len;
cscov_partial = 0;
}
if (ip_len != len) {

View File

@ -227,9 +227,10 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
nxt = ip6->ip6_nxt;
cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0;
if (nxt == IPPROTO_UDPLITE && ulen == 0) {
if (nxt == IPPROTO_UDPLITE && (ulen == 0 || ulen == plen)) {
/* Zero means checksum over the complete packet. */
ulen = plen;
if (ulen == 0)
ulen = plen;
cscov_partial = 0;
}
if (nxt == IPPROTO_UDP && plen != ulen) {