ether_addr_equal_masked(9)
π ether_addr_equal_masked(9) π
okay bestie, so this one's a kernel API manual page β it lives in the kernel doc world, and honestly? it's giving "small function, big personality." let's get into it β¨
πΈ NAME πΈ
ether_addr_equal_masked β compare two Ethernet addresses with a mask, bestie π
π SYNOPSIS π
bool ether_addr_equal_masked (const u8 *addr1 , const u8 *addr2 , const u8 *mask );
like, that's it. that's the whole vibe. returns a bool, takes three pointers, no cap π«Ά
π¦ ARGUMENTS π¦
addr1β pointer to a six-byte array holding the 1st Ethernet address π (yes, exactly six bytes, don't come at me with five)addr2β pointer to a six-byte array holding the 2nd Ethernet address πΈ (also six bytes, we stan consistency)maskβ pointer to a six-byte array holding the Ethernet address bitmask π
β DESCRIPTION β
so here's the tea: this function compares two Ethernet addresses with a mask, and it returns true if β for every single bit that's set in the bitmask β the equivalent bits in the two Ethernet addresses are equal. literally bit-for-bit matching, but only where the mask says "yeah look here" π₯
and the iconic little footnote: using a mask with all bits set is just a slower ether_addr_equal. like, it works, it's valid, but bestieβ¦ you're paying extra for the same thing π so if your mask is all 1s, maybe just call the other one, iykyk π
π SEE ALSO π
all the siblings live in the kernel file ./include/linux/etherdevice.h, and here's the full family reunion:
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_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)
likeβ¦ that's the whole group chat, and every one of them is invited π§π
ngl the only real caution here is that all-bits-set mask thing β it's not wrong, it's just slower than ether_addr_equal. no cap, no drama, just vibes π
and that's the page, bestie!! π source: ./include/linux, dated October 2026 β periodt, go compare some 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