compare_ether_header(9)
π compare_ether_header(9)
okay so bestie, welcome to the Kernel API Manual page for compare_ether_header(9) β we're comparing Ethernet headers and it's giving "tiny function, big networking energy." β¨
πΈ NAME
compare_ether_header β compare two Ethernet headers π«Ά
β¨ SYNOPSIS
unsigned long compare_ether_header (const void *a , const void *b );
π ARGUMENTS
aβ pointer to an Ethernet header πbβ pointer to an Ethernet header π
π₯ DESCRIPTION
This one compares two Ethernet headers and returns 0 if equal. Periodt. π
It assumes that the network header (i.e., the IP header) is 4-byte aligned OR that the platform can handle unaligned access. That's the case for all packets coming into netif_receive_skb or similar entry points. no cap, that's literally the contract. β¨
heads up bestie: this alignment / unaligned-access assumption is part of the whole vibe check for this function. π
π SEE ALSO
Kernel file ./include/linux/etherdevice.h β and the whole 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)is_etherdev_addr(9)eth_hw_addr_gen(9)eth_skb_pkt_type(9)eth_skb_pad(9)
cute little sign-off: this page's source sits in ./include/linux, dated October 2026 β that's the source/version-and-date situation, bestie, and compare_ether_header(9) is officially done. mwah ππβ¨
π¦ 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