UDPLite requires a checksum. Therefore, discard a received packet if

the checksum is 0.

MFC after: 3 days
This commit is contained in:
tuexen 2014-09-30 20:29:58 +00:00
parent ee5d6ff91c
commit e642e7ce0e

View File

@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, int proto)
m_freem(m);
return (IPPROTO_DONE);
}
} else
UDPSTAT_INC(udps_nosum);
} else {
if (proto == IPPROTO_UDP) {
UDPSTAT_INC(udps_nosum);
} else {
/* UDPLite requires a checksum */
/* XXX: What is the right UDPLite MIB counter here? */
m_freem(m);
return (IPPROTO_DONE);
}
}
pcbinfo = get_inpcbinfo(proto);
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||