batadv_gw_reselect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… batadv_gw_reselect β€” the batadv_gw_reselect(9) page, bestie edition

okay so real talk, this is a Kernel API Manual entry, and it's a short one but it's iconic in its own lowkey way 🌸 the whole thing lives in the batman-adv gateway world, and we're about to get into it. no cap.


✨ NAME ✨

batadv_gw_reselect β€” force a gateway reselection 🫢

like, you're nudging the mesh and being like "bestie, maybe re-vote?" and that's the whole vibe.


πŸ’« SYNOPSIS πŸ’«

void batadv_gw_reselect (struct batadv_priv *bat_priv );

that's it. that's the function. void return, one pointer, no drama (well, some drama, see DESCRIPTION) πŸ’€


πŸŽ€ ARGUMENTS πŸŽ€

  • bat_priv β€” the bat priv with all the mesh interface information ✨ it's giving "everything you need to know about this mesh interface, all in one struct" energy. main character struct, honestly.

πŸ”₯ DESCRIPTION πŸ”₯

so what this actually does is set a flag 🚩 and that flag is basically a little sticky note that says "hey GW component, reminder to perform a new gateway reselection." very remember to buy milk but for mesh gateways. we stan a reminder system.

BUT β€” and this is the part where you need to listen, bestie β€” this function does not ensure that the current gateway is going to be deselected 😭 the reselection mechanism may elect the same gateway once again. it's literally the "we held an election and the incumbent won again" situation. democracy, baby. πŸ—³οΈ

so the tea is: invoking batadv_gw_reselect does not guarantee a gateway change, and therefore a uevent is not necessarily expected. don't be out here waiting for a uevent that never comes and then blaming yourself, that's not your fault, that's just the API being honest with you πŸ’–

⚠️ lowkey important: "force a reselection" β‰  "force a different gateway". reselection can absolutely hand you the exact same one back. internalise this and you'll save yourself so much confusion, fr fr.

πŸ¦‹ SEE ALSO πŸ¦‹

the whole gateway_client.c friend group, because they all show up together like a group chat:

every single one, accounted for, no crumbs left behind 🧚✨


🌈 sign-off 🌈

this lil masterpiece comes to you from ./net/batman-adv, dated October 2026, and remember the name: batadv_gw_reselect(9) πŸ‘‘ that's the whole page bestie, go force a reselection (or don't β€” it might just pick the same gateway again πŸ’€) ily, bye πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from