Date: Thu, 16 May 2019 11:20:02 +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-11@freebsd.org Subject: svn commit: r347688 - stable/11/sys/netinet6 Message-ID: <201905161120.x4GBK2Xv004190@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161120.x4GBK2Xv004190>