svn commit: r272660 - stable/10/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Mon Oct 6 16:59:26 UTC 2014


Author: tuexen
Date: Mon Oct  6 16:59:25 2014
New Revision: 272660
URL: https://svnweb.freebsd.org/changeset/base/272660

Log:
  MFC r272326:
  UDPLite requires a checksum. Therefore, discard a received packet if
  the checksum is 0.

Modified:
  stable/10/sys/netinet/udp_usrreq.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/udp_usrreq.c
==============================================================================
--- stable/10/sys/netinet/udp_usrreq.c	Mon Oct  6 15:48:28 2014	(r272659)
+++ stable/10/sys/netinet/udp_usrreq.c	Mon Oct  6 16:59:25 2014	(r272660)
@@ -488,8 +488,16 @@ udp_input(struct mbuf *m, int off)
 			m_freem(m);
 			return;
 		}
-	} else
-		UDPSTAT_INC(udps_nosum);
+	} else {
+		if (pr == IPPROTO_UDP) {
+			UDPSTAT_INC(udps_nosum);
+		} else {
+			/* UDPLite requires a checksum */
+			/* XXX: What is the right UDPLite MIB counter here? */
+			m_freem(m);
+			return;
+		}
+	}
 
 	pcbinfo = get_inpcbinfo(pr);
 	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||


More information about the svn-src-stable mailing list