nla_put(9)
π 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:
__nla_validate(9)nla_policy_len(9)__nla_parse(9)nla_find(9)nla_strscpy(9)nla_strdup(9)nla_memcpy(9)nla_memcmp(9)nla_strcmp(9)__nla_reserve(9)__nla_reserve_64bit(9)__nla_reserve_nohdr(9)nla_reserve(9)nla_reserve_64bit(9)nla_reserve_nohdr(9)__nla_put(9)__nla_put_64bit(9)__nla_put_nohdr(9)nla_put_64bit(9)nla_put_nohdr(9)nla_append(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms