ethnl_update_binary(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ethnl_update_binary(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're deep in the kernel, you've got a netlink attribute, and you need to jam its payload into a buffer. that's the whole gig. this function is a little legend and it's about to eat. periodt.


✨ SYNOPSIS ✨

void ethnl_update_binary (void *dst , unsigned int len , const struct
nlattr *attr , bool *mod );

yes it's that simple, no cap. void in, void out, vibes in between 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dst β€” the value you're updating. the main character of this whole operation, honestly.
  • len β€” destination buffer length, aka how much room dst has. know your limits bestie πŸ’…
  • attr β€” the netlink attribute carrying the new value, or null. (null = we're not doing anything, go touch grass 🌸)
  • mod β€” pointer to a bool for modification tracking. it's the receipts. it remembers if stuff actually changed πŸ“

🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” you take the u8 value from the NLA_U8 netlink attribute attr and use it to rewrite the data block of length len at dst with the attribute payload. like a glow-up but for bytes ✨

if attr is null, do nothing. literally nothing. it's giving "i'm not getting involved" πŸ’€

the bool that mod points to gets set to true if this function changed the logical value of *dst. if it didn't change anything, it's left as is β€” no meddling, no drama πŸ™ˆ

ngl the whole point is the mod flag. it's how the rest of the code knows whether to actually care. lowkey iconic.

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file: ./net/ethtool/netlink.h

the whole friend group, fr fr:


and that's the page!! source is ./net/ethtool, dated October 2026 β€” so like, future vibes but make it kernel πŸ§šπŸ’œ bye bestie, go update some binary data responsibly πŸ”₯πŸ‘‘

πŸ“¦ where this page comes from