batadv_gw_dh...ecipient_get(9)
π 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 forchaddrβ the buffer where the client address gets stashed. valid only if the function returnsBATADV_DHCP_TO_CLIENTπ (like, don't go reading it otherwise, iykyk)
π DESCRIPTION π
β οΈ warning warning warning π¨ β this function may reallocate the skb data buffer viapskb_may_pull/... so like, any pointer into the skb data (e.g. one you got fromskb->dataoreth_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 wherechaddris 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:
batadv_gw_node_release(9)batadv_gw_get_selected_gw_node(9)batadv_gw_get_selected_orig(9)batadv_gw_select(9)batadv_gw_reselect(9)batadv_gw_check_client_stop(9)batadv_gw_election(9)batadv_gw_check_election(9)batadv_gw_node_add(9)batadv_gw_node_get(9)batadv_gw_node_update(9)batadv_gw_node_delete(9)batadv_gw_node_free(9)batadv_gw_dump(9)batadv_gw_out_of_range(9)
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
- 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