STRUCT SKB_EXT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct skb_ext(9) β€” the kernel API manual, but make it make sense

okay bestie so you've stumbled into the kernel API manual page for struct skb_ext(9) and honestly? it's giving "small struct, big responsibilities." let's get into it πŸ’…


✨ NAME ✨

struct skb_ext β€” sk_buff extensions, aka the little sidecar situation for your sockets. iconic behaviour, no cap πŸŽ€


🌸 SYNOPSIS 🌸

here's the whole vibe, copy it exactly, don't touch a character:

struct skb_ext {
    refcount_t refcnt;
    u8 offset[SKB_EXT_NUM];
    u8 chunks;
    char data[];
 };

look at her. main character energy. variable-length data[] at the end? we love a flexible array member πŸ¦‹


πŸ‘‘ Members πŸ‘‘

  • refcnt β€” starts at 1 on allocation and gets deallocated on 0. so like, when the refcount hits zero, she's gone, periodt πŸ’€
  • offset β€” the offset to add to data to obtain the extension address. math girlie behaviour fr fr
  • chunks β€” the size currently allocated, stored in SKB_EXT_ALIGN_SHIFT units. yes, units, keep up 🫢
  • data β€” start of extension data, variable sized. she grows, she shrinks, she contains multitudes ✨

⭐ Note ⭐

bestie listen up because this is the whole trick: offsets/lengths are stored in chunks of 8 bytes. this allows you to use u8 types while allowing up to 2kb worth of extension data. it's giving "clever packing" and honestly? ate. πŸ”₯

like, u8 looking smol but carrying up to 2kb of info? that's the kind of sly engineering i'm obsessed with 🌈


πŸ¦‹ SEE ALSO πŸ¦‹

okay so this is the part where we list everything, and i do mean everything β€” the whole friend group, the extended universe, the group chat. grab a snack πŸ“

like i said. the entire extended universe. iykyk 😭


that's the whole page bestie, go forth and be normal about skb extensions πŸ’–

source/version and date, so you know this is legit: <pink>./include/linux</pink> , <purple>October 2026</purple> β€” mwah, you're welcome 🫢✨

πŸ“¦ where this page comes from