skb_checksum_trimmed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

skb_checksum_trimmed(9) ✨

bestie, this page is from the Kernel API Manual, and it is officially giving β€œvalidate checksum of an skb” energy. iconic, honestly.


πŸ’– NAME πŸ’–

skb_checksum_trimmed β€” validate checksum of an skb

✨ SYNOPSIS ✨

struct sk_buff * skb_checksum_trimmed (struct sk_buff *skb , unsigned
       int transport_len , __sum16(*skb_chkf)(struct sk_buff *skb) );

πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the skb to check. main character behavior.
  • transport_len β€” the data length beyond the network header. like, the amount past the network header, iykyk.
  • skb_chkf β€” checksum function to use. your chosen checksum bestie.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so skb_checksum_trimmed applies the given checksum function skb_chkf to the provided skb. It returns a checked and maybe trimmed skb β€” and if it goes wrong, it returns NULL on error. no cap. 🫢

If the skb has data beyond the given transport length, then a trimmed & cloned skb is checked and returned. The way it just handles the extra data with a trim-and-clone moment? obsessed. πŸ’…

Caller responsibilities, and do not skip these: the caller needs to set the skb transport header and free any returned skb if it differs from the provided skb. Fr fr, if the returned skb differs from the one you passed in, free it.

🌈 SEE ALSO 🌈

Kernel file: ./net/core/skbuff.c

The whole linked-up squad β€” every single one, periodt:


bye bestie 🫢 this page’s source/version is ./net/core and it’s dated October 2026 β€” now go validate those checksums and slay πŸ’…βœ¨

πŸ“¦ where this page comes from