eth_header(9)
β¨ eth_header(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a lil function called eth_header, and it's literally the glow-up artist for Ethernet headers. let's get into it π
πΈ NAME πΈ
eth_header β create the Ethernet header β¨ (yes that's the whole vibe, it makes the header)
π¦ SYNOPSIS π¦
int eth_header (struct sk_buff *skb , struct net_device *dev , unsigned
short type , const void *daddr , const void *saddr , unsigned int len );
like, six whole arguments, she's high maintenance but she delivers π
π ARGUMENTS π
skbβ the buffer you're about to alter, bestie. this is the thing getting the makeover π«Άdevβ the source device. where it's coming from, iykyktypeβ the Ethernet type field. the whole personality of the packet tbhdaddrβ destination address. passNULLand you're leaving the destination address alone πsaddrβ source address. passNULLand it just uses the device source address, no drama β¨lenβ packet length. gotta be<= skb->len, so keep it in range or it's giving chaos π
π₯ DESCRIPTION π₯
so what she does: sets the protocol type. that's the main character move π
but here's the lil twist β for a packet of type ETH_P_802_3/2, you put the length in here instead. not the type. the length. the way that just flips the whole script, ngl π
π SEE ALSO π
- Kernel file
./net/ethernet/eth.c eth_get_headlen(9)eth_type_trans(9)eth_header_cache(9)eth_header_cache_update(9)eth_header_parse_protocol(9)eth_prepare_mac_addr_change(9)eth_commit_mac_addr_change(9)eth_mac_addr(9)ether_setup(9)alloc_etherdev_mqs(9)platform_get_ethdev_address(9)nvmem_get_mac_address(9)fwnode_get_mac_address(9)device_get_mac_address(9)device_get_ethdev_address(9)
aaand that's the whole page, bestie π§π she lives in ./net/ethernet, dated October 2026, and the source/version is the Kernel API Manual β go forth and build headers, periodt π
πβ
π¦ 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