From owner-svn-src-stable@FreeBSD.ORG Thu Feb 12 18:02:47 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7FD106566C; Thu, 12 Feb 2009 18:02:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8C28FC17; Thu, 12 Feb 2009 18:02:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CI2li0063040; Thu, 12 Feb 2009 18:02:47 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CI2ktB063039; Thu, 12 Feb 2009 18:02:46 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902121802.n1CI2ktB063039@svn.freebsd.org> From: Randall Stewart Date: Thu, 12 Feb 2009 18:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188525 - in stable/7/sys: . netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 18:02:48 -0000 Author: rrs Date: Thu Feb 12 18:02:46 2009 New Revision: 188525 URL: http://svn.freebsd.org/changeset/base/188525 Log: MFC of 184027: Reported by Yehuda Weinraub (yehudasa@gamil.com) - CRC32C algorithm uses incorrect init_bytes value. It SHOULD have the number of bytes to get to a 4 byte boundary. PR: 128134 Modified: stable/7/sys/ (props changed) stable/7/sys/netinet/sctp_crc32.c Modified: stable/7/sys/netinet/sctp_crc32.c ============================================================================== --- stable/7/sys/netinet/sctp_crc32.c Thu Feb 12 17:57:28 2009 (r188524) +++ stable/7/sys/netinet/sctp_crc32.c Thu Feb 12 18:02:46 2009 (r188525) @@ -583,13 +583,13 @@ update_crc32(uint32_t crc32c, unsigned char *buffer, unsigned int length) { - uint32_t offset; + uint32_t to_even_word; if (length == 0) { return (crc32c); } - offset = ((uintptr_t) buffer) & 0x3; - return (sctp_crc32c_sb8_64_bit(crc32c, buffer, length, offset)); + to_even_word = (4 - (((uintptr_t) buffer) & 0x3)); + return (sctp_crc32c_sb8_64_bit(crc32c, buffer, length, to_even_word)); } uint32_t sctp_crc_c[256] = {