Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2014 08:46:50 +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: r272469 - head/sys/netinet6
Message-ID:  <201410030846.s938koJ6037452@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri Oct  3 08:46:49 2014
New Revision: 272469
URL: https://svnweb.freebsd.org/changeset/base/272469

Log:
  UPD and UDPLite require a checksum. So check for it.
  
  MFC after: 3 days

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c	Fri Oct  3 04:13:25 2014	(r272468)
+++ head/sys/netinet6/udp6_usrreq.c	Fri Oct  3 08:46:49 2014	(r272469)
@@ -237,11 +237,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?201410030846.s938koJ6037452>