nla_reserve_64bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nla_reserve_64bit β€” the kernel API manual, bestie edition πŸŽ€

okay so we're doing nla_reserve_64bit(9) today and honestly? she's that girl. this is a page from the Kernel API Manual and it's lowkey iconic, so let's get into it ✨


✨ NAME ✨

nla_reserve_64bit β€” reserve room for an attribute on the skb and align it πŸ’– (yes that's the whole vibe, she reserves room and she aligns, periodt)


🌸 SYNOPSIS 🌸

struct nlattr * nla_reserve_64bit (struct sk_buff *skb , int attrtype ,
       int attrlen , int padattr );

like literally just look at her signature, she's serving 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the socket buffer you're reserving room on, that's the canvas bestie 🎨
  • attrtype β€” the attribute type, iykyk
  • attrlen β€” length of the attribute payload, so how much stuff you're putting in there
  • padattr β€” the attribute type used for the padding 🌈

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so what she actually does: she adds a netlink attribute header to a socket buffer and reserves room for the payload β€” but does not copy it. not her job, not her problem πŸ’…. she also makes sure this attribute will have a 64-bit aligned nla_data area, which is the whole point of her existence, no cap ✨

and if the tailroom of the skb is insufficient to store the attribute header and payload? she returns NULL. that's it, that's the whole mood 😭

fr fr though β€” check for that NULL, bestie. she's not gonna warn you, she's just gonna hand you nothing and move on πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/nlattr.c β€” and like, the whole friend group:

she literally runs with the whole squad, we love a connected queen 🌸


aaaand that's the page!! πŸŽ€ sign-off time: this one lives in ./lib and it's dated October 2026 β€” so go forth, reserve your 64-bit aligned room, and slay πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from