Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 17:14:31 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r272664 - stable/10/sys/netinet6
Message-ID:  <201410061714.s96HEVww095988@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410061714.s96HEVww095988>