svn commit: r272326 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Tue Sep 30 20:29:59 UTC 2014
Author: tuexen
Date: Tue Sep 30 20:29:58 2014
New Revision: 272326
URL: http://svnweb.freebsd.org/changeset/base/272326
Log:
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.
MFC after: 3 days
Modified:
head/sys/netinet/udp_usrreq.c
Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c Tue Sep 30 20:18:10 2014 (r272325)
+++ head/sys/netinet/udp_usrreq.c Tue Sep 30 20:29:58 2014 (r272326)
@@ -498,8 +498,16 @@ udp_input(struct mbuf **mp, int *offp, i
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)) ||
More information about the svn-src-all
mailing list