batadv_primary_if_select(9)
π batadv_primary_if_select(9) β the Kernel API Manual glow-up π
okay so bestie, we're in the Kernel API Manual today, and the star of the show is batadv_primary_if_select β¨ (yes the whole page title is literally that, iykyk). she's a lil function with one job and she does it beautifully π
πΈ NAME πΈ
batadv_primary_if_select β bestie's whole thing is selecting the new primary interface, no cap π
β¨ SYNOPSIS β¨
void batadv_primary_if_select (struct batadv_priv *bat_priv , struct
batadv_hard_iface *new_hard_iface );
like, look at her signature. void return, two args, iconic behavior π
π¦ ARGUMENTS π¦
bat_privβ thebat_privthat's holding all the mesh interface information π«Ά like she's carrying the whole group chatnew_hard_ifaceβ the new primary interface. and plot twist: she may beNULLπ (yes really, that's allowed)
π₯ DESCRIPTION π₯
so what she does is: she replaces the currently selected primary interface with new_hard_iface. simple. slay. π
then β not done yet β she invokes the algorithm-specific primary_set hook βοΈ (whatever algorithm you're running gets its little moment, main character energy tbh).
and finally, she updates the originator MAC address π so everything stays in sync. three-step routine, ate and left no crumbs πβ¨
π SEE ALSO π
the whole Kernel file is ./net/batman-adv/hard-interface.c and honestly she has SO many friends, here's the full squad π:
batadv_hardif_release(9)batadv_hardif_get_by_netdev(9)batadv_getlink_net(9)batadv_mutual_parents(9)batadv_is_on_batman_iface(9)batadv_is_valid_iface(9)__batadv_get_real_netdev(9)batadv_get_real_netdev(9)batadv_is_wext_netdev(9)batadv_is_cfg80211_netdev(9)batadv_wifi_flags_evaluate(9)batadv_netdev_get_wifi_flags(9)batadv_hardif_get_wifi_flags(9)batadv_is_wifi_hardif(9)batadv_hardif_no_broadcast(9)batadv_hardif_get_active(9)batadv_primary_if_update_addr(9)batadv_hardif_is_iface_up(9)batadv_check_known_mac_addr(9)batadv_hardif_recalc_extra_skbroom(9)batadv_hardif_min_mtu(9)batadv_update_min_mtu(9)batadv_hardif_activate_interface(9)batadv_hardif_deactivate_interface(9)batadv_hardif_enable_interface(9)batadv_hardif_disable_interface(9)batadv_hard_if_event_meshif(9)batadv_wifi_net_device_insert(9)batadv_wifi_net_device_remove(9)batadv_wifi_net_device_update(9)batadv_wifi_net_device_unregister(9)batadv_wifi_net_device_event(9)batadv_hard_if_event(9)batadv_wifi_net_devices_init(9)batadv_wifi_net_devices_deinit(9)
like, thirty-something references. she's connected. she's networked. literally πΈοΈπ
π«Ά friendly reminder bestie:new_hard_ifacecan legit beNULL, that's in the docs, that's not me being messy π
and that's the whole page, periodt ππ she lives in ./net/batman-adv, this doc is from October 2026, and the page is β say it with me β batadv_primary_if_select(9) β¨ππΈ bye bestie, go read some more hard-interface.c ππ
π¦ 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