Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 17:12:04 +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: r272663 - stable/10/sys/netinet6
Message-ID:  <201410061712.s96HC4ej095641@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Mon Oct  6 17:12:03 2014
New Revision: 272663
URL: https://svnweb.freebsd.org/changeset/base/272663

Log:
  MFC r272408:
  Check for UDP/IPv6 packets that the length in the UDP header is at least
  the minimum. Make the check similar to the one for UDPLite/IPv6.

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:08:19 2014	(r272662)
+++ stable/10/sys/netinet6/udp6_usrreq.c	Mon Oct  6 17:12:03 2014	(r272663)
@@ -235,18 +235,9 @@ udp6_input(struct mbuf **mp, int *offp, 
 			/* XXX: What is the right UDPLite MIB counter? */
 			goto badunlocked;
 		}
-	}
-	if (nxt == IPPROTO_UDP && plen != ulen) {
-		UDPSTAT_INC(udps_badlen);
-		goto badunlocked;
-	}
-
-	/*
-	 * Checksum extended UDP header and data.
-	 */
-	if (uh->uh_sum == 0) {
-		if (ulen > plen || ulen < sizeof(struct udphdr)) {
-			UDPSTAT_INC(udps_nosum);
+	} else {
+		if ((ulen < sizeof(struct udphdr)) || (plen != ulen)) {
+			UDPSTAT_INC(udps_badlen);
 			goto badunlocked;
 		}
 	}



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