ethnl_update_u32(9)
π 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 theu32 *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 aboolthat'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 flipsmodtotrue. 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:
ethnl_strz_size(9)ethnl_put_strz(9)ethnl_update_u8(9)ethnl_update_u8_u32(9)ethnl_update_bool32(9)ethnl_update_bool(9)ethnl_update_binary(9)ethnl_update_bitfield32(9)ethnl_reply_header_size(9)struct ethnl_req_info(9)ethnl_req_get_phydev(9)struct ethnl_reply_data(9)struct ethnl_request_ops(9)
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
- 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