eth_hw_addr_random(9)
π eth_hw_addr_random(9) π
okay bestie, so this is a page from the Kernel API Manual and it's about one tiny little function that does one tiny little thing and honestly? it's kind of iconic. no cap.
β¨ NAME β¨
eth_hw_addr_random β generate a software assigned random Ethernet and set the device flag π
like, it makes a random MAC and then it tells everyone about it (via a flag). main character energy fr.
π¦ SYNOPSIS π¦
void eth_hw_addr_random (struct net_device *dev );
that's it. that's the whole signature. void in, void out, no return value to stress about π
πΈ ARGUMENTS πΈ
devβ pointer tonet_devicestructure. yes queen, you gotta hand over a pointer to thenet_deviceyou want to mess with π«Ά
π DESCRIPTION π
so here's the vibe check: this function generates a random Ethernet address (MAC) that's meant to be used by a net device. and then β this is the part people forget β it sets addr_assign_type so that the state can be read by sysfs and can be used by userspace.
basically:
- random MAC gets made π²
- the device gets it β¨
addr_assign_typegets set so sysfs can read the state π- and userspace can actually use that info π
the way that this is literally just "make random MAC, be transparent about it" β the honesty of it all π
ngl bestie, the addr_assign_type bit is the whole point. a random address with no record of why it's random is just chaos. this function is chaos with receipts π
π§ SEE ALSO π§
okay this is the part where the page just. keeps. going. and honestly we love a thorough girlie π
it all lives in the kernel file ./include/linux/etherdevice.h, and here's the full squad:
is_link_local_ether_addr(9)is_zero_ether_addr(9)is_multicast_ether_addr(9)is_local_ether_addr(9)is_broadcast_ether_addr(9)is_unicast_ether_addr(9)is_valid_ether_addr(9)eth_proto_is_802_3(9)eth_random_addr(9)eth_broadcast_addr(9)eth_zero_addr(9)eth_hw_addr_crc(9)ether_addr_copy(9)eth_hw_addr_set(9)eth_hw_addr_inherit(9)ether_addr_equal(9)ether_addr_equal_64bits(9)ether_addr_equal_unaligned(9)ether_addr_equal_masked(9)ether_addr_to_u64(9)u64_to_ether_addr(9)eth_addr_dec(9)eth_addr_inc(9)eth_addr_add(9)is_etherdev_addr(9)compare_ether_header(9)eth_hw_addr_gen(9)eth_skb_pkt_type(9)eth_skb_pad(9)
twenty-nine whole entries, bestie. twenty-nine. and you know every single one of them is somebody's hyperfixation π
and that's the page!! no notes, she's perfect π β¨
sign-off time: this lil beauty lives in ./include/linux and the version on the tin says October 2026 β and the page is, of course, eth_hw_addr_random(9) ππ«Άπ
π¦ 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