batadv_dat_check_dhcp(9)
π batadv_dat_check_dhcp(9) β the Kernel API Manual moment π
okay so bestie, this one is a kernel API page, like from the batman-adv manual set, and it's actually so much less scary than the name looks. it's giving "small function, big job" energy β¨ let's get into it.
β¨ SYNOPSIS β¨
int batadv_dat_check_dhcp (struct sk_buff *skb , __be16 proto , __be32
*ip_src );
literally three args, one return value, no cap. π«Ά
π ARGUMENTS π
skbβ the packet you want checked. the star of the show πprotoβ an ethernet protocol hint, and lowkey the important detail: this one sits behind a potential vlan, so it's the hint, not always the raw thing you'd expect.ip_srcβ a buffer where the IPv4 source address gets stored. you bring the buffer, it does the filling π
π DESCRIPTION π
so what does it even do?? it checks whether the skb you handed it is a valid DHCP packet. that's the whole vibe check. and if it passes β slay β it stores the IPv4 source address in the buffer you provided. π
β οΈ but here's the thing, bestie: the caller has to make sure the skb's network header is set correctly. that's not this function's job. it's not gonna go fix that for you, so do it before you call it, fr fr. π
π₯ RETURN π₯
- if
skbis a valid DHCP packet β you get back its op code (thinkBOOTREPLYvs.BOOTREQUEST). iconic. π - otherwise β
-EINVAL. not iconic, but very informative π
π SEE ALSO π
the whole friend group, no one left out β kernel file ./net/batman-adv/distributed-arp-table.c and all of these legends:
enum batadv_bootpop(9)enum batadv_boothtype(9)enum batadv_dhcpoptioncode(9)enum batadv_dhcptype(9)struct batadv_dhcp_packet(9)struct batadv_dhcp_header(9)struct batadv_dhcp_option_header(9)batadv_dat_start_timer(9)batadv_dat_entry_release(9)batadv_dat_entry_put(9)batadv_dat_to_purge(9)__batadv_dat_purge(9)batadv_dat_purge(9)batadv_compare_dat(9)batadv_arp_hw_src(9)batadv_arp_ip_src(9)batadv_arp_hw_dst(9)batadv_arp_ip_dst(9)batadv_hash_dat(9)batadv_dat_entry_hash_find(9)batadv_dat_entry_add(9)batadv_dbg_arp(9)batadv_is_orig_node_eligible(9)batadv_choose_next_candidate(9)batadv_dat_select_candidates(9)batadv_dat_forward_data(9)batadv_dat_tvlv_container_update(9)batadv_dat_status_update(9)batadv_dat_tvlv_ogm_handler_v1(9)batadv_dat_hash_free(9)batadv_dat_init(9)batadv_dat_free(9)batadv_dat_cache_dump_entry(9)batadv_dat_cache_dump_bucket(9)batadv_dat_cache_dump(9)batadv_arp_get_type(9)batadv_dat_get_vid(9)batadv_dat_arp_create_reply(9)batadv_dat_snoop_outgoing_arp_request(9)batadv_dat_snoop_incoming_arp_request(9)batadv_dat_snoop_outgoing_arp_reply(9)batadv_dat_snoop_incoming_arp_reply(9)batadv_dat_check_dhcp_ipudp(9)batadv_dat_get_dhcp_message_type(9)batadv_dat_dhcp_get_yiaddr(9)batadv_dat_get_dhcp_chaddr(9)batadv_dat_put_dhcp(9)batadv_dat_check_dhcp_ack(9)batadv_dat_snoop_outgoing_dhcp_ack(9)batadv_dat_snoop_incoming_dhcp_ack(9)batadv_dat_drop_broadcast_packet(9)
and that's the whole page, bestie β go read some of that DHCP lore, it's lowkey fascinating π¦
okay ily, bye π β this cute little sign-off comes to you from ./net/batman-adv, dated October 2026, and the function is still out here doing its DHCP checks. periodt. β¨
π¦ 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