batadv_dat_s...t_candidates(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 picture
  • ip_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:


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 said batadv_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