batadv_dat_s...ing_dhcp_ack(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– batadv_dat_s...ing_dhcp_ack(9) πŸ’–

okay bestie, so this is a page from the Kernel API Manual β€” yes, the whole batadv_dat_s...ing_dhcp_ack(9) situation β€” and honestly? It's lowkey iconic. It's a tiny little function that quietly does its job in the batman-adv mesh world, and we're gonna go through it together, no cap. πŸ¦‹


✨ NAME ✨

batadv_dat_snoop_incoming_dhcp_ack β€” snoop DHCPACK and fill DAT cache 🌸

Like, it's literally a little eavesdropper that catches a DHCPACK and neatly files the info away. Main character energy fr.


πŸŽ€ SYNOPSIS πŸŽ€

void batadv_dat_snoop_incoming_dhcp_ack (struct batadv_priv *bat_priv ,
struct sk_buff *skb , int hdr_size );

πŸ’… ARGUMENTS πŸ’…

  • bat_priv β€” the bat priv with all the mesh interface information πŸ‘‘ like, it's the whole vibe of your mesh interface, everything lives in there
  • skb β€” the packet to snoop πŸ•΅οΈβ€β™€οΈ yes bestie, we're being nosy on purpose, it's fine
  • hdr_size β€” header size, up to the tail of the batman-adv header πŸ“

🌈 DESCRIPTION 🌈

So here's the tea, bestie. This function first checks whether the given skb is a valid DHCPACK. πŸ“ If it is β€” slay β€” then its source MAC and IP, as well as its DHCP Client Hardware Address field and DHCP Your IP Address field, get added to the local DAT cache. Four little pieces of info, all tucked in. Periodt. ✨

⚠️ Warning, and this one is serious: This function may reallocate the skb data buffer via pskb_may_pull/batadv_dat_get_vid/... Any pointer into the skb data (e.g. obtained from skb->data or eth_hdr) before this call must be considered invalid afterwards and has to be reacquired. 😭 Like, do NOT hold onto those pointers, they are gone, they are not coming back, reacquire or perish. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/batman-adv/distributed-arp-table.c, plus the whole extended friend group:


aaaand that's the whole page, bestie 🫢 this little corner of the kernel lives in ./net/batman-adv, dated October 2026 πŸ’œ go forth and snoop responsibly βœ¨πŸŽ€πŸ§š

πŸ“¦ where this page comes from