ethnl_update_bool(9)
π 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, ornull. yes,nullis 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?modsaystrue. unchanged?modstays as is. periodt.
π§ SEE ALSO π§
Kernel file ./net/ethtool/netlink.h, plus the whole friend group π«Ά:
ethnl_strz_size(9)ethnl_put_strz(9)ethnl_update_u32(9)ethnl_update_u8(9)ethnl_update_u8_u32(9)ethnl_update_bool32(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)
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
- 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