Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Oct 2014 10:49:02 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272408 - head/sys/netinet6
Message-ID:  <201410021049.s92An2Mk002941@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Thu Oct  2 10:49:01 2014
New Revision: 272408
URL: https://svnweb.freebsd.org/changeset/base/272408

Log:
  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.
  
  MFC after: 3 days

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c	Thu Oct  2 10:46:12 2014	(r272407)
+++ head/sys/netinet6/udp6_usrreq.c	Thu Oct  2 10:49:01 2014	(r272408)
@@ -237,18 +237,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?201410021049.s92An2Mk002941>