nla_put_nohdr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 -EMSGSIZE coming back, your skb just 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 🧚


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