eth_hw_addr_gen(9)
πΈ NAME πΈ
eth_hw_addr_gen β Generate and assign Ethernet address to a port π
okay so this page is eth_hw_addr_gen(9) from the Kernel API Manual, and it's literally here to help you generate and assign an Ethernet address to a port. iconic.
β¨ SYNOPSIS β¨
void eth_hw_addr_gen (struct net_device *dev , const u8 *base_addr ,
unsigned int id );
π ARGUMENTS π
devβ pointer to port'snet_devicestructure π«Άbase_addrβ base Ethernet address β¨idβ offset to add to the base address π
π DESCRIPTION π
So basically: generate a MAC address using a base address and an offset, then assign it to a net_device. That's the whole vibe check β
.
Switch drivers are the ones that commonly use this, because they need to compute addresses for all their ports β it's giving βone base address, many portsβ main character energy π.
important note bestie: addr_assign_type is not changed. Not even a little. No cap. π
π¦ SEE ALSO π¦
fr fr, check the kernel file ./include/linux/etherdevice.h, plus all these besties:
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_random(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_skb_pkt_type(9)eth_skb_pad(9)
made with π from ./include/linux, October 2026, for eth_hw_addr_gen(9) β bye bestie, go generate those addresses slay β¨π«Ά
π¦ 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