skb_scrub_packet(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… skb_scrub_packet(9) β€” the glow-up your skb gets before it crosses borders πŸ¦‹

okay so this one's from the Kernel API Manual, bestie β€” it's a (9) page, meaning it's kernel-internal API, not your average ls situation. Let's get into it πŸ’–


✨ NAME ✨

skb_scrub_packet β€” scrub an skb 🧼🫧


🌸 SYNOPSIS 🌸

void skb_scrub_packet (struct sk_buff *skb , bool xnet );

πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the buffer you wanna clean 🧽 like, the actual thing getting scrubbed
  • xnet β€” says whether the packet is crossing netns (network namespaces, iykyk) 🌐

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: skb_scrub_packet is your go-to after you've encapsulated or decapsulated a packet into/from a tunnel πŸŒ€ some information has got to be cleared during those operations β€” that's just how it is, no cap.

it's also the move when you need to clean an skb before injecting it in another namespace β€” that's the xnet == true case, and it's kind of the whole plot πŸ”₯

the reason? we have to clear all the information in the skb that could impact namespace isolation πŸ›‘οΈ like, every last crumb. leaving stuff behind = vibe leak, and we do not leak across namespaces, periodt.


🌈 SEE ALSO 🌈

the kernel file ./net/core/skbuff.c, plus literally the entire skb cinematic universe β€” grab a snack, this is a long one πŸ“:


and that's the whole page, bestie 🫢 this one lives in ./net/core and it's dated October 2026 β€” so screenshot it, cite it, frame it, whatever, it's iconic πŸ‘‘βœ¨

πŸ“¦ where this page comes from