Author: rrs
Date: Sat Oct 18 15:53:31 2008
New Revision: 184027
URL: http://svn.freebsd.org/changeset/base/184027

Log:
  Reported by Yehuda Weinraub ([EMAIL PROTECTED]) - CRC32C algorithm
  uses incorrect init_bytes value. It SHOULD have the number
  of bytes to get to a 4 byte boundary.
  
  PR:   128134
  MFC after:    4 weeks

Modified:
  head/sys/netinet/sctp_crc32.c

Modified: head/sys/netinet/sctp_crc32.c
==============================================================================
--- head/sys/netinet/sctp_crc32.c       Sat Oct 18 13:39:22 2008        
(r184026)
+++ head/sys/netinet/sctp_crc32.c       Sat Oct 18 15:53:31 2008        
(r184027)
@@ -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] = {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to