csum_fold(9)
okay bestie, welcome to csum_fold(9) in the Kernel API Manual β itβs giving βfold the checksum, invert it, serveβ energy πβ¨
β¨ NAME β¨
csum_fold β fold and invert a 32bit checksum. Also, the page says sum: 32bit unfolded sum, so thatβs the vibe for the argument π«Ά
π SYNOPSIS π
The signature, exactly:
__sum16 csum_fold (__wsum sum );
π ARGUMENTS π
sumβ the manpage is so real for just saying-- undescribed --π but the NAME line tells us itβs the 32bit unfolded sum.
πΈ DESCRIPTION πΈ
Okay so csum_fold folds a 32bit running checksum down to 16bit and inverts it. Thatβs the whole move β¨ This is usually the last step before putting a checksum into a packet.
Make sure not to mix with 64bit checksums. No mixing, periodt π
π¦ SEE ALSO π¦
- Kernel file
./arch/x86/um/asm/checksum.h ip_fast_csum(9)
cute little sign-off: this page comes from ./arch/x86/um/asm (thatβs the source/version) and is dated October 2026. csum_fold(9) said what it said, and we ate π
π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms