is_etherdev_addr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 calls ether_addr_equal_64bits, so you gotta take care of the right padding. that's literally why addr is 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 🫢✨:


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