batadv_dat_s...t_candidates(9)
β¨ batadv_dat_select_candidates(9) β¨
okay so bestie, welcome to the Kernel API Manual π
today's main character is batadv_dat_select_candidates(9) and honestly? she picks friends for the DHT. literally her whole job. let's get into it π«Ά
πΈ NAME πΈ
batadv_dat_select_candidates β select the nodes which the DHT message has to be sent to
like, the friend-picker. the group-chat invite list. the DHT message goes to these nodes, no cap π
π¦ SYNOPSIS π¦
struct batadv_dat_candidate * batadv_dat_select_candidates (struct
batadv_priv *bat_priv , __be32 ip_dst , unsigned short vid );
she returns a pointer to a struct batadv_dat_candidate, and she takes three things. that's it. that's the vibe β¨
π ARGUMENTS π
bat_privβ the bat priv with all the mesh interface information π₯ this is the whole mesh-interface info bundle, okay, she needs the full pictureip_dstβ ipv4 to look up in the DHT. this is the address you're hunting for in the distributed ARP table πvidβ VLAN identifier π don't forget it, she's not optional
π§ DESCRIPTION π§
okay so here's the actual tea β and it's lowkey precise:
An originator O is selected if and only if its DHT_ID value is one of three closest values (from the LEFT, with wrap around if needed) then the hash value of the key.
read that again. three closest. from the LEFT. with wrap around if needed. and ip_dst is the key π
like, the algorithm is giving very demure, very mindful, very "we look left and if we fall off the edge we wrap around" π no cap, wrap-around matters, don't sleep on it.
β RETURN β
the candidate array of size BATADV_DAT_CANDIDATE_NUM π
that's the array. that size. exactly that size. periodt π
π SEE ALSO π
Kernel file ./net/batman-adv/distributed-arp-table.c β go read her, she's iconic:
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_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_check_dhcp(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, you ate that π β¨
this cutie came from./net/batman-adv, dated October 2026, and yes the header/footer saidbatadv_dat_s...t_candidates(9)both times because the kernel manpages love a symmetrical moment π bye, ily, go read the source πΈ
π¦ 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