ethnl_update_binary(9)
π 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 roomdsthas. 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:
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_bool(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 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
- 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