skb_ext_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… skb_ext_add β€” the kernel API manual, bestie edition

okay so you're reading skb_ext_add(9) from the Kernel API Manual, and honestly? it's a whole little baddie. let's get into it πŸŽ€


✨ NAME ✨

skb_ext_add β€” allocate space for given extension, COW if needed

like yes, that's literally the job. allocate space, and if it's a clone situation, copy-on-write does its lil magic 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

void * skb_ext_add (struct sk_buff *skb , enum skb_ext_id id );

she takes two things and hands you back a void *. iconic signature, no notes πŸ’…


πŸ“ ARGUMENTS πŸ“

  • skb β€” the buffer. the main character of this whole operation 🫢
  • id β€” which extension you want space for. this is the extension, the one you're investing in ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, bestie:

skb_ext_add allocates enough space for the given extension. that's it, that's the allocation. and if the extension is already present? she doesn't make a scene β€” she just returns a pointer to that extension. slay πŸ’–

now, the plot twist: if the skb was cloned, COW applies. that means copy-on-write is doing its thing, and the returned memory can be modified without changing the extension space of the clones' buffers. so you can go off and write to it, and the clones stay unbothered, living their own lives 🌈 no cap.

returns a pointer to the extension, or NULL on allocation failure 😭 β€” so like, always check that pointer, fr fr. allocation failure is real and she will not warn you twice.


πŸ’€ SEE ALSO πŸ’€

the vibes, the lore, the entire friend group. kernel file ./net/core/skbuff.c plus this absolute wall of icons β€” every single one, i'm not skipping a single bestie:


reminder bestie: NULL on allocation failure is a real outcome, not a personality trait. check it πŸ™ˆ

okay that's the page!! and before you go β€” this whole thing lives in ./net/core, dated October 2026, and it's skb_ext_add(9)'s world, we're just reading it πŸ’œ mwah, go forth and allocate responsibly βœ¨πŸ¦‹

πŸ“¦ where this page comes from