eth_header(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, iykyk
  • type β€” the Ethernet type field. the whole personality of the packet tbh
  • daddr β€” destination address. pass NULL and you're leaving the destination address alone πŸ™ˆ
  • saddr β€” source address. pass NULL and 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 🌈


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