Changeset 11038 in vbox for trunk/src/VBox/Runtime/common/checksum
- Timestamp:
- Jul 31, 2008 5:20:59 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33933
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/checksum/ipv4.cpp
r11013 r11038 40 40 * Calculates the checksum of the IPv4 header. 41 41 * 42 * @returns Checksum .42 * @returns Checksum (network endian). 43 43 * @param pIpHdr Pointer to the IPv4 header to checksum, network endian (big). 44 44 * Assumes the caller already checked the minimum size requirement. … … 120 120 */ 121 121 uint16_t u16Sum = RTNetIPv4HdrChecksum(pIpHdr); 122 if (RT_UNLIKELY( RT_BE2H_U16(pIpHdr->ip_sum)!= u16Sum))122 if (RT_UNLIKELY(pIpHdr->ip_sum != u16Sum)) 123 123 return false; 124 124 return true; … … 348 348 * Finalizes a IPv4 checksum [inlined]. 349 349 * 350 * @returns The checksum .350 * @returns The checksum (network endian). 351 351 * @param u32Sum The 32-bit intermediate checksum value. 352 352 */ … … 363 363 * Finalizes a IPv4 checksum. 364 364 * 365 * @returns The checksum .365 * @returns The checksum (network endian). 366 366 * @param u32Sum The 32-bit intermediate checksum value. 367 367 */ … … 370 370 return rtNetIPv4FinalizeChecksum(u32Sum); 371 371 } 372 373 372 374 373 … … 377 376 * UDP header and payload. 378 377 * 379 * @returns The checksum .378 * @returns The checksum (network endian). 380 379 * @param pIpHdr Pointer to the IPv4 header, in network endian (big). 381 380 * @param pUdpHdr Pointer to the UDP header, in network endian (big). … … 450 449 return false; 451 450 uint16_t u16Sum = RTNetIPv4UDPChecksum(pIpHdr, pUdpHdr, pvData); 452 if (RT_UNLIKELY( RT_BE2H_U16(pUdpHdr->uh_sum)!= u16Sum))451 if (RT_UNLIKELY(pUdpHdr->uh_sum != u16Sum)) 453 452 return false; 454 453 return true; 455 454 } 455 456
Note:
See TracChangeset
for help on using the changeset viewer.