is_etherdev_addr(9)
π is_etherdev_addr(9) β the "wait, is this YOUR MAC address bestie?" check
okay so we're deep in the Kernel API Manual today, and this little icon is is_etherdev_addr(9) β¨. It's a tiny bool-returning helper from the networking headers, and honestly it's giving "small but essential" π.
πΈ NAME πΈ
is_etherdev_addr β tells you whether a given Ethernet address actually belongs to the device. like, does this MAC live here or not π
β¨ SYNOPSIS β¨
bool is_etherdev_addr (const struct net_device *dev , const u8 addr[6 +
2] );
(yes, that 6 + 2 is doing a little padding moment, keep reading, we get there π«Ά)
π¦ ARGUMENTS π¦
devβ pointer to a device structure. the device we're checking against, your main character here πaddrβ pointer to a six-byte array containing the Ethernet address. six bytes. that's the whole MAC. no cap π
π DESCRIPTION π
So what it actually does: it compares the address you passed in against all the addresses of the device. If that address is one of the device's addresses, it returns true πβ¨ periodt.
π₯Ί important caveat, do not skip this: this function callsether_addr_equal_64bits, so you gotta take care of the right padding. that's literally whyaddris declared as[6 + 2]up in the synopsis. the padding is not a vibe, it's a requirement π
π₯ SEE ALSO π₯
Kernel file ./include/linux/etherdevice.h β and like, the entire etherdevice friend group π«Άβ¨:
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)compare_ether_header(9)eth_hw_addr_gen(9)eth_skb_pkt_type(9)eth_skb_pad(9)
and that's the whole page, bestie π this cutie lives in ./include/linux, and the version vibes are October 2026 ππ go forth and compare your addresses 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