__nla_put_64bit(9)
π __nla_put_64bit β Kernel API Manual energy β¨
okay so bestie, welcome to the group chat where we learn how to shove a netlink attribute into a socket buffer and align it. yes, it's a kernel API manual page, no it's not boring, and yes you're gonna slay this. π
β¨ NAME β¨
__nla_put_64bit β add a netlink attribute to a socket buffer and align it π
(that's the whole vibe. add attribute. align it. done. iconic.)
πΈ SYNOPSIS πΈ
void __nla_put_64bit (struct sk_buff *skb , int attrtype , int attrlen ,
const void *data , int padattr );
look at that signature. gorgeous. returns void, which lowkey means "no take-backs, no error codes, you're on your own" π
π¦ ARGUMENTS π¦
skbβ the socket buffer you're adding the attribute to. this is the main character, the canvas, the whole venue π«Άattrtypeβ the attribute type. literally just, what kind of attribute is this π«attrlenβ length of the attribute payload. how many bytes of Actual Content we're rocking β¨dataβ head of the attribute payload. i.e. where the good stuff starts πpadattrβ attribute type for the padding. yes the padding gets its own type, she has her own identity, respect her π
π₯ DESCRIPTION π₯
so here's the tea: the caller β that's you, bestie β is responsible for making sure the skb actually has enough tailroom for the attribute header and the payload.
β οΈ read that again. you make sure there's enough tailroom. nobody's checking for you. this function is not your mom, it's not doing a vibe check on your buffer. no cap. π
that's it. that's the whole description. short, sweet, and it will absolutely bite you if you skip the tailroom part π
π SEE ALSO π
the whole ./lib/nlattr.c friend group, and honestly they're all iconic:
__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_nohdr(9)nla_put(9)nla_put_64bit(9)nla_put_nohdr(9)nla_append(9)
so many functions. so many underscores. the __ prefix is giving "i'm the internal one, use my public sibling if you're normal" π§
anyway that's the page!! go forth, check your tailroom, and remember: come from ./lib, stay for the padding β¨
mwah π β signed, your favorite kernel manual, dated October 2026, shipped from ./lib, and yes the footer still says __nla_put_64bit(9) because branding is forever π
π¦ 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