eth_addr_add(9)
β¨ eth_addr_add(9) β¨
okay so bestie, this one's from the Kernel API Manual and it's genuinely so simple you're gonna scream. it's eth_addr_add, and yes before you ask, it does exactly what it says on the tin π
πΈ NAME πΈ
eth_addr_add β Add (or subtract) an offset to/from the given MAC address.
like... math but make it networking π¦
β¨ SYNOPSIS β¨
void eth_addr_add (u8 *addr , long offset );
no return value, it just does the thing. main character energy fr π₯
π ARGUMENTS π
addrβ Pointer to a six-byte array containing the Ethernet address to increment. six bytes, bestie, that's a MAC address, don't get cute and pass something else πoffsetβ Offset to add. and yeah the title says "or subtract" β that's because it's along, so you can just hand it a negative number and it'll happily go the other way π
ngl the long type on the offset is doing a lot of heavy lifting here β that's the whole trick for going backwards, so don't overthink it π
π SEE ALSO π
all the siblings live in the Kernel file ./include/linux/etherdevice.h and honestly it's a whole family reunion in there, so let's give everyone a shoutout π«Ά
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)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 29 friends and every single one of them is invited to the group chat, iykyk π
and that's the whole page!! short, sweet, and iconic β it lives in ./include/linux, dated October 2026, so go forth and increment (or decrement, we don't judge) your MAC addresses, bestie πβπ
π¦ 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