__nla_put(9)
β¨ __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 π§:
__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_64bit(9)__nla_put_nohdr(9)nla_put(9)nla_put_64bit(9)nla_put_nohdr(9)nla_append(9)
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
- 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