ethnl_update_bool(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ethnl_update_bool β€” a.k.a. the ethnl_update_bool(9) page, kernel API manual edition πŸŽ€

okay so bestie, we're in the Kernel API Manual today and this is genuinely one of the cutest little helper functions ever. it's called ethnl_update_bool(9), it lives in ./net/ethtool, and it's here to take a netlink attribute and gently turn it into a real actual bool. no cap. let's get into it ✨


🌸 NAME 🌸

ethnl_update_bool β€” updateb bool used as bool from NLA_U8 attribute

(not me copying that typo verbatim btw, it's literally in the original and i'm not about to gaslight you about it πŸ’€)


πŸ¦‹ SYNOPSIS πŸ¦‹

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

like… she's a void. she gives nothing back. she just does things. main character energy honestly πŸ‘‘


πŸ’… ARGUMENTS πŸ’…

  • dst β€” the value to update. this is the bool getting a whole glow-up.
  • attr β€” the netlink attribute with the new value, or null. yes, null is allowed here, she's flexible 🫢
  • mod β€” pointer to a bool used for modification tracking. this one's keeping receipts πŸ“

✨ DESCRIPTION ✨

okay so here's the vibe 🌈

Use the bool value from the NLA_U8 netlink attribute attr to set the bool variable pointed to by dst to 0 (if zero) or 1 (if not). literally that simple β€” zero goes to zero, anything-not-zero goes to one. one job, and she ate πŸ”₯

If attr is null, do nothing. nope. nada. she's not gonna touch it. respect πŸ’…

The bool pointed to by mod is set to true if this function changed the logical value of *dst, otherwise it is left as is. so mod is basically the "did i make a difference today" flag, and if you didn't change anything it just stays exactly how you left it. mood πŸŽ€

lowkey the whole thing is a vibe check on an attribute: null? ignore. zero? 0. not zero? 1. changed? mod says true. unchanged? mod stays as is. periodt.

🧚 SEE ALSO 🧚

Kernel file ./net/ethtool/netlink.h, plus the whole friend group 🫢:


and that's the whole page, bestie β€” go update some bools responsibly πŸ’–

signed off from ./net/ethtool, October 2026, on the ethnl_update_bool(9) page β€” mwah πŸ’‹

πŸ“¦ where this page comes from