batadv_arp_get_type(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

batadv_arp_get_type β€” bestie, this one parses an ARP packet and hands you back its type ✨

Oh and hiiii, quick vibe check before we dive in: this is batadv_arp_get_type(9), straight out of section 9 of the Kernel API Manual. She's a kernel function, she's lowkey iconic, let's get into it πŸŽ€


🌸 SYNOPSIS 🌸

u16 batadv_arp_get_type (struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • bat_priv β€” the bat priv, aka the main character that's holding all the mesh interface information πŸ’…
  • skb β€” the packet we're analysing, our little subject under the microscope πŸ”
  • hdr_size β€” the size of whatever header might be chilling in front of the ARP packet inside the skb πŸ“

✨ DESCRIPTION ✨

⚠️ Warning, bestie, read this part twice: this function may reallocate the skb data buffer via pskb_may_pull/... (pskb_may_pull and friends, iykyk).

Okay so what that means is: any pointer into the skb data β€” like one you got from skb->data or from eth_hdr β€” that you were holding before this call? Consider it invalid the moment you come back. Gone. Expired. Not it. 😭 You have to reacquire it, no cap. Do not hold onto the old pointer and act like nothing happened, that's giving undefined-behaviour main character energy and we do not stan πŸ’€


πŸ‘‘ RETURN πŸ‘‘

Returns the ARP type if the skb actually contains a valid ARP packet β€” and 0 otherwise 🫢


🌈 SEE ALSO 🌈

Kernel file ./net/batman-adv/distributed-arp-table.c plus the whole squad:


and that's the whole page, bestie!! go parse those ARP packets responsibly, reacquire your pointers, and remember: the data buffer might have moved. love u, bye πŸ’œπŸ§šβ€β™€οΈ

mwah πŸ’‹ β€” sourced from ./net/batman-adv, dated October 2026, and yes that's the same batadv_arp_get_type(9) we've been screaming about this whole time πŸ“

πŸ“¦ where this page comes from