svn commit: r347688 - stable/11/sys/netinet6

Michael Tuexen tuexen at FreeBSD.org
Thu May 16 11:20:03 UTC 2019


Author: tuexen
Date: Thu May 16 11:20:02 2019
New Revision: 347688
URL: https://svnweb.freebsd.org/changeset/base/347688

Log:
  MFC r346402:
  
  When a checksum has to be computed for a received IPv6 packet because it
  is requested by the application using the IPPROTO_IPV6 level socket option
  IPV6_CHECKSUM on a raw socket, ensure that the packet contains enough
  bytes to contain the checksum at the specified offset.

Modified:
  stable/11/sys/netinet6/raw_ip6.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/raw_ip6.c
==============================================================================
--- stable/11/sys/netinet6/raw_ip6.c	Thu May 16 11:18:50 2019	(r347687)
+++ stable/11/sys/netinet6/raw_ip6.c	Thu May 16 11:20:02 2019	(r347688)
@@ -198,7 +198,8 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
 		INP_RLOCK(in6p);
 		if (in6p->in6p_cksum != -1) {
 			RIP6STAT_INC(rip6s_isum);
-			if (in6_cksum(m, proto, *offp,
+			if (m->m_pkthdr.len - (*offp + in6p->in6p_cksum) < 2 ||
+			    in6_cksum(m, proto, *offp,
 			    m->m_pkthdr.len - *offp)) {
 				INP_RUNLOCK(in6p);
 				RIP6STAT_INC(rip6s_badsum);


More information about the svn-src-all mailing list