nla_put_nohdr(9)
π nla_put_nohdr β Kernel API Manual (section 9, bestie)
okay so picture this: you're deep in kernel land, poking at a struct sk_buff, and you need to slide a netlink attribute in there β but like, without the header. yeah. that's this function. she does exactly one thing and she does it iconically. welcome to nla_put_nohdr π
πΈ NAME πΈ
nla_put_nohdr β add a netlink attribute without a header. no header, no problem, no cap β¨
π¦ SYNOPSIS π¦
int nla_put_nohdr (struct sk_buff *skb , int attrlen , const void *data );
three args, one int back, she's lowkey minimalist and I respect it π
π ARGUMENTS π
skbβ the socket buffer you're adding the attribute to. this is the vibe container, the main character buffer, the thing getting the glow-up π«Άattrlenβ the length of the attribute payload. how many bytes of payload we're talking about, fr fr.dataβ the head of the attribute payload. like, the start of your data. the beginning. the origin story π
β¨ DESCRIPTION β¨
okay so here's the tea: if the tailroom of the skb isn't big enough to store the attribute payload, this function returns -EMSGSIZE. that's it. that's the whole behavioral contract. no room = -EMSGSIZE, and honestly? she's telling you the truth, you should listen π
ngl if you see-EMSGSIZEcoming back, yourskbjust doesn't have the tailroom for the payload. not a skill issue, just a room issue. π
π SEE ALSO π
the whole netlink attribute friend group, all hanging out in the kernel file ./lib/nlattr.c β go say hi to all of them, they're literally a family π§
__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(9)nla_put_64bit(9)nla_append(9)
that's the whole page bestie, go forth and put some no-header attributes π¦π
β sourced from ./lib, dated October 2026, and yes I'm signing off with a π because she deserves it. slay, stay safe, and watch your tailroom π
β¨
π¦ 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