__nla_put(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __nla_put(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’… this one's a little function with big main character energy β€” it's the one that actually shoves a netlink attribute into a socket buffer. let's get into it 🫢


🌸 NAME 🌸

__nla_put β€” add a netlink attribute to a socket buffer ✨

like, that's literally the whole job. put the attribute in the buffer. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

void __nla_put (struct sk_buff *skb , int attrtype , int attrlen , const
void *data );

yes the const and void *data are on their own line up there, that's just how the manpage formats it, don't come for me 😭 β€” copy it exactly if you're typing it out, fr fr.


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the socket buffer you're adding the attribute to. this is the vibe container πŸ’–
  • attrtype β€” the attribute type. which flavour of attribute are we talking about, iykyk ✨
  • attrlen β€” length of the attribute payload. how many bytes of actual content, no cap πŸ“
  • data β€” head of the attribute payload. the pointer to where the good stuff starts πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so here's the thing, and ngl this is the part you can't skip:

the caller is responsible for making sure the skb actually has enough tailroom for the attribute header and the payload. like, both of them. the whole thing. 🫠

⚠️ lowkey important: that's on you, not on the function. __nla_put is not out here doing vibe checks on your buffer space. if there isn't enough tailroom, that's a you problem πŸ’€

periodt. that's the whole description. short and iconic πŸ‘‘


🌈 SEE ALSO 🌈

literally the whole friend group, all hanging out in the kernel file ./lib/nlattr.c β€” go say hi to all of them 🧚:


and that's the page!! πŸŽ‰ sourced from ./lib, dated October 2026 β€” mwah, timestamped and everything πŸ’‹ thanks for reading bestie, go reserve some tailroom before you call this, ily, bye!! πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from