STRUCT INET_FRAG_QUEUE(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct inet_frag_queue(9) โ€” kernel API manual, but make it make sense

okay bestie, so this page is all about struct inet_frag_queue, aka the fragment queue โœจ โ€” literally the data structure the kernel uses when it's holding onto all the lil' pieces of a datagram until it can put them back together. think of it as the group chat where every fragment has to show up before the convo can actually be read ๐Ÿซถ


โœจ SYNOPSIS โœจ

here's the whole struct exactly as it lives, no cap, every field in order ๐Ÿ’–

struct inet_frag_queue {
    struct rhash_head       node;
    union {
      struct frag_v4_compare_key v4;
      struct frag_v6_compare_key v6;
    } key;
    struct timer_list       timer;
    spinlock_t lock;
    refcount_t refcnt;
    struct rb_root          rb_fragments;
    struct sk_buff          *fragments_tail;
    struct sk_buff          *last_run_head;
    ktime_t stamp;
    int len;
    int meat;
    u8 tstamp_type;
    __u8 flags;
    u16 max_size;
    struct fqdir            *fqdir;
    struct rcu_head         rcu;
 };

๐ŸŒธ Members ๐ŸŒธ

like. the whole cast. main character energy each and every one ๐Ÿ‘‘

  • node โ€” the rhash node, bestie. it's how this queue sits in the hash. ๐Ÿ’ซ
  • key โ€” the keys that identify this frag, lowkey its whole identity ๐Ÿชช
  • timer โ€” the queue expiration timer โฐ yes she has a deadline
  • lock โ€” the spinlock protecting this frag ๐Ÿ”’ do not skip the lock, fr fr
  • refcnt โ€” reference count of the queue ๐Ÿงฎ
  • rb_fragments โ€” received fragments rb-tree root ๐ŸŒณ the family tree of pieces
  • fragments_tail โ€” received fragments tail ๐Ÿ‘ (no seriously, the tail)
  • last_run_head โ€” the head of the last "run". see ip_fragment.c ๐Ÿ” iykyk
  • stamp โ€” timestamp of the last received fragment โฑ๏ธ
  • len โ€” total length of the original datagram ๐Ÿ“ the big picture
  • meat โ€” length of received fragments so far ๐Ÿฅฉ (yes it's literally called meat, and yes i'm obsessed)
  • tstamp_type โ€” stamp has a mono delivery time (EDT) ๐Ÿ•ฐ๏ธ
  • flags โ€” fragment queue flags ๐Ÿšฉ
  • max_size โ€” maximum received fragment size ๐Ÿ“ฆ
  • fqdir โ€” pointer to struct fqdir ๐Ÿ‘‰
  • rcu โ€” rcu head for freeing deferall ๐Ÿงน (yes, that's how it's spelled on the page, we don't gatekeep)
ngl the meat field is the icon here. it's giving "the actual payload received so far" and honestly? slay.

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

  • ./include/net/inet_frag.h โ€” Kernel file ๐ŸŒˆ
  • enum (anonymous)(9) โ€” also in that header, go read it, it's right there ๐ŸŽ€

๐Ÿ’œ the cute sign-off ๐Ÿ’œ

this lil' page lives in ./include/net, and the version tag on it reads October 2026 โ€” so yes, bestie, she's from the future and she's still just a fragment queue. periodt. ๐Ÿงš๐ŸŒธ

pages like this are why you read the header files โ€” go put your fragments back together responsibly ๐Ÿ’–

๐Ÿ“ฆ where this page comes from