Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2014 05:05:54 +0000 (UTC)
From:      Pyun YongHyeon <yongari@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: r266210 - stable/10/sys/netinet
Message-ID:  <201405160505.s4G55sj9020650@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri May 16 05:05:53 2014
New Revision: 266210
URL: http://svnweb.freebsd.org/changeset/base/266210

Log:
  MFC r265942:
    Fix checksum computation.  Previously it didn't include carry.

Modified:
  stable/10/sys/netinet/ip_input.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/ip_input.c
==============================================================================
--- stable/10/sys/netinet/ip_input.c	Fri May 16 03:18:09 2014	(r266209)
+++ stable/10/sys/netinet/ip_input.c	Fri May 16 05:05:53 2014	(r266210)
@@ -1085,8 +1085,9 @@ found:
 	 * (and not in for{} loop), though it implies we are not going to
 	 * reassemble more than 64k fragments.
 	 */
-	m->m_pkthdr.csum_data =
-	    (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16);
+	while (m->m_pkthdr.csum_data & 0xffff0000)
+		m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) +
+		    (m->m_pkthdr.csum_data >> 16);
 #ifdef MAC
 	mac_ipq_reassemble(fp, m);
 	mac_ipq_destroy(fp);



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