ethnl_update_u32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so picture this: you're deep in <pink>ethnl_update_u32</pink> land, section 9 of the Kernel API Manual, and you just need to move a u32 out of a netlink attribute and into your variable. that's it. that's the whole vibe. she's a tiny helper and she ate. 🫢


✨ SYNOPSIS ✨

void ethnl_update_u32 (u32 *dst , const struct nlattr *attr , bool *mod );

literally one line, three args, zero drama. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • dst β€” the value you're updating. the main character, fr. this is the u32 * that actually gets written to.
  • attr β€” the netlink attribute holding the new value, or <italic>null</italic>. yep, null is a totally valid look here, we'll get to that. πŸ™ˆ
  • mod β€” a pointer to a bool that's tracking whether anything got modified. she's the receipts-keeper. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is: copy the u32 value out of the NLA_U32 netlink attribute attr and drop it into the variable pointed to by dst. simple. iconic. no notes. 🧚

and if attr is <italic>null</italic>? she does nothing. doesn't crash, doesn't complain, just minds her business. we love a low-maintenance function. 😌

meanwhile the bool pointed to by mod gets set to true if this function actually changed the value of *dst. if it didn't change anything, that bool is left as is β€” not set to false, not touched, just... left. so don't go assuming she resets it for you, bestie. ⚠️

ngl the "left as is" part is the one thing you gotta remember. she only ever flips mod to true. she never un-flips it. periodt. πŸ’€

🌈 SEE ALSO 🌈

all her friends in the kernel file ./net/ethtool/netlink.h, plus the whole update-and-reply crew:

go read them all, iykwyk. πŸ“šπŸ’–


and that's the page, babe. brought to you by ./net/ethtool, dated October 2026, version ethnl_update_u32(9) β€” slay, bye! πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from