skb_trim(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’‡β€β™€οΈ skb_trim(9) β€” bestie edition

okay so this is a page from the Kernel API Manual (skb_trim(9), if you're keeping track πŸ“’) and it's honestly so short it's giving minimal effort in the best way. let's get into it ✨


πŸ’– NAME πŸ’–

skb_trim β€” remove end from a buffer

like… you're literally just yeeting stuff off the tail of a buffer. that's the whole thing. slay πŸ’…


✨ SYNOPSIS ✨

void skb_trim (struct sk_buff *skb , unsigned int len );

void return, two args, no drama. we love a function that doesn't overcomplicate things 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the buffer you're altering. this is your main character right here πŸ‘‘
  • len β€” the new length you want it to be πŸ“

🌸 DESCRIPTION 🌸

so the vibe is: you cut the length of a buffer down by removing data from the tail. think of it like trimming your split ends β€” you're only touching the end, nothing else moves πŸ¦‹

if the buffer is already under the length specified, it is not modified. no cap, nothing happens, it just stays exactly as it is. the function is not about to grow your buffer for you, that's not her job πŸ™…β€β™€οΈ

🚨 important caveat bestie: the skb must be linear. that's not a suggestion, that's the rule. keep that in mind or things get weird 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/core/skbuff.c β€” and like, every skb function that has ever existed, apparently. this list ate and left no crumbs:

iykyk πŸ’€


🫢 that's the whole page. tiny function, enormous SEE ALSO, extremely on brand for kernel docs ngl.

and finally, the cute lil sign-off: this one lives in ./net/core, it's dated October 2026, and yes β€” it's still skb_trim(9) at the end, same as at the top. periodt 🌈⭐

πŸ“¦ where this page comes from