nla_put(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nla_put(9) β€” Kernel API Manual ✨

okay so real talk, this is nla_put(9) from the Kernel API Manual, and it's literally the little function that slides a netlink attribute into a socket buffer. bestie, it's giving "glue code but make it iconic" πŸŽ€


🌸 NAME 🌸

nla_put β€” Add a netlink attribute to a socket buffer. that's it. that's the whole job. and it ate πŸ’…


✨ SYNOPSIS ✨

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

look at her. four params, one int coming back at you. main character energy fr fr πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the socket buffer you're adding the attribute to. this is the canvas, the vibe, the whole stage πŸ‘‘
  • attrtype β€” the attribute type. like, what kind of attribute is this? identity crisis solved πŸ’«
  • attrlen β€” length of the attribute payload. how many bytes of snack are we packing πŸ“
  • data β€” head of the attribute payload. pointer to where the good stuff starts 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: it returns -EMSGSIZE if the tailroom of the skb is insufficient to store the attribute header and payload. that's the whole desc. no cap, that's the entire behavioural paragraph. if there's not enough tailroom, you get -EMSGSIZE and that's just how it is 😭 no extra lore, no secret bonus behaviour, we don't invent things here ✨

ngl, the entire documented behaviour is that error path. factual queen. lowkey obsessed πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./lib/nlattr.c β€” go read the source, iykyk 🧚 and while you're at it, the whole friend group:

like, the entire nla_ friend group showed up to the party and honestly? slay πŸ”₯


and that's the page!! sign-off time: this one lives in ./lib, dated October 2026, brought to you in nla_put(9) form β€” periodt, go touch some tailroom bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from