mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
Fix CRC32c calculation on 64-bit platforms.
Patch by Pontus Andersson. http://seclists.org/nmap-dev/2012/q4/361
This commit is contained in:
parent
c11d183718
commit
8d6dce4a01
2 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
|||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o Fixed CRC32c calculation (as used in SCTP scans) on 64-bit
|
||||
platforms. [Pontus Andersson]
|
||||
|
||||
o [NSE] Added multicast group name output to
|
||||
broadcast-igmp-discovery.nse. [Vasily Kulikov]
|
||||
|
||||
|
|
|
|||
|
|
@ -560,14 +560,17 @@ unsigned long nbase_crc32(unsigned char *buf, int len)
|
|||
|
||||
/*
|
||||
* CRC-32C (Castagnoli) Cyclic Redundancy Check.
|
||||
* Taken straight from RFC 4960 (SCTP).
|
||||
* Taken straight from Appendix C of RFC 4960 (SCTP), with the difference that
|
||||
* the remainder register (crc32) is initialized to 0xffffffffL rather than ~0L,
|
||||
* for correct operation on platforms where unisigned long is longer than 32
|
||||
* bits.
|
||||
*/
|
||||
|
||||
/* Return the CRC-32C of the bytes buf[0..len-1] */
|
||||
unsigned long nbase_crc32c(unsigned char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
unsigned long crc32 = ~0L;
|
||||
unsigned long crc32 = 0xffffffffL;
|
||||
unsigned long result;
|
||||
unsigned char byte0, byte1, byte2, byte3;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue