svn commit: r272664 - stable/10/sys/netinet6

Michael Tuexen tuexen at FreeBSD.org
Mon Oct 6 17:14:32 UTC 2014


Author: tuexen
Date: Mon Oct  6 17:14:31 2014
New Revision: 272664
URL: https://svnweb.freebsd.org/changeset/base/272664

Log:
  MFC r272469:
  UDP/IPv6 and UDPLite/IPv6 require a checksum. So check for it.

Modified:
  stable/10/sys/netinet6/udp6_usrreq.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet6/udp6_usrreq.c
==============================================================================
--- stable/10/sys/netinet6/udp6_usrreq.c	Mon Oct  6 17:12:03 2014	(r272663)
+++ stable/10/sys/netinet6/udp6_usrreq.c	Mon Oct  6 17:14:31 2014	(r272664)
@@ -235,11 +235,19 @@ udp6_input(struct mbuf **mp, int *offp, 
 			/* 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) &&


More information about the svn-src-all mailing list