batadv_gw_dh...ecipient_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… batadv_gw_dhcp_recipient_get(9) β€” the ✨ Kernel API Manual ✨ glow-up

okay so bestie, buckle up, because we're diving into batadv_gw_dhcp_recipient_get from the Kernel API Manual and honestly? she's lowkey iconic. this one's a little detective function β€” it peeks at a packet and tells you if it's a DHCP message and which way it's headed πŸ•΅οΈβ€β™€οΈβœ¨


🌸 NAME 🌸

batadv_gw_dhcp_recipient_get β€” literally just checks if a packet is a DHCP message, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

enum batadv_dhcp_recipient batadv_gw_dhcp_recipient_get (struct sk_buff
*skb , unsigned int *header_len , u8 *chaddr );

πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the packet we're snooping on, bestie. this is the one getting the vibe check πŸ•΅οΈβ€β™€οΈ
  • header_len β€” a pointer to the batman-adv header size, so she knows how much to account for
  • chaddr β€” the buffer where the client address gets stashed. valid only if the function returns BATADV_DHCP_TO_CLIENT πŸ‘‘ (like, don't go reading it otherwise, iykyk)

πŸ’– DESCRIPTION πŸ’–

⚠️ warning warning warning 🚨 β€” this function may reallocate the skb data buffer via pskb_may_pull/... so like, any pointer into the skb data (e.g. one you got from skb->data or eth_hdr) from before this call? consider it invalidated afterwards πŸ’€ you have to reacquire it. no reusing stale pointers, that's not the vibe, fr fr.

πŸ”₯ RETURN πŸ”₯

she returns one of three things, and each one is a whole mood:

  • BATADV_DHCP_NO β€” nope, not a dhcp message, OR there was an error while parsing it 😭 (either way, not it)
  • BATADV_DHCP_TO_SERVER β€” ooh she's a message going to the DHCP server ✨
  • BATADV_DHCP_TO_CLIENT β€” and this one's going to a DHCP client 🫢 (this is the one where chaddr is actually valid, remember!)

🌈 SEE ALSO 🌈

kernel file ./net/batman-adv/gateway_client.c β€” go read it, she ate πŸ‘‘

this whole squad of functions, all together, main character energy:


and that's the whole page, bestie πŸŽ€ this lil drop comes to you from ./net/batman-adv, dated October 2026 β€” slay, go forth and parse those DHCP packets responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from