batadv_window_protected(9)
π batadv_window_protected(9) β or, like, the vibe-check that catches a host restarting
okay bestie, welcome to the Kernel API Manual β¨ β yes this is a section 9 page, kernel-internals territory, we're literally in the source code now π«Ά β and today's main character is batadv_window_protected, which highkey does exactly what the NAME says: it checks whether the host restarted and is in the protection time. π΅οΈββοΈβ°
that's it. that's the job. no cap. π
β¨ SYNOPSIS β¨
bool batadv_window_protected (struct batadv_priv *bat_priv , s32
seq_num_diff , s32 seq_old_max_diff , unsigned long *last_reset , bool
*protection_started );
five arguments, one bool coming back out. she's compact, she's iconic, she takes her job very seriously π₯
πΈ ARGUMENTS πΈ
bat_privβ the bat priv, aka the thing holding all the mesh interface information π like, every single mesh interface detail lives in here, this is the whole bag.seq_num_diffβ the difference between the current / received sequence number and the last sequence number. basically "how far off are we from last time" πseq_old_max_diffβ the maximum age of a sequence number that is not considered as a restart. so anything older than this cutoff? yeah, that's getting flagged as a restart. β οΈlast_resetβ jiffies timestamp of the last reset π°οΈ and heads up, this one gets updated when a reset is detected. she's not read-only, she's a whole mutable queen πprotection_startedβ gets set totrueif the protection window was started, and it does not change otherwise. so if the window already started, this stays exactly how you left it, no touchy π
π¦ RETURN π¦
two possible vibes, and you gotta read them right:
falseβ the packet is to be accepted β slay, let it throughtrueβ the packet is to be ignored π nope, we're not touching that
fr fr, don't flip these in your head β true means "ignore", not "yes it's protected, all good". it's giving counterintuitive and we respect it anyway π
π§ SEE ALSO π§
the whole friend group π«Ά β first up, the kernel file ./net/batman-adv/routing.c, then every single one of these:
_batadv_update_route(9)batadv_update_route(9)batadv_check_management_packet(9)batadv_skb_decrement_ttl(9)batadv_recv_my_icmp_packet(9)batadv_recv_icmp_ttl_exceeded(9)batadv_recv_icmp_packet(9)batadv_check_unicast_packet(9)batadv_last_bonding_get(9)batadv_last_bonding_replace(9)batadv_find_router(9)batadv_route_unicast_packet(9)batadv_reroute_unicast_packet(9)batadv_check_unicast_ttvn(9)batadv_recv_unhandled_unicast_packet(9)batadv_recv_unicast_packet(9)batadv_recv_unicast_tvlv(9)batadv_recv_frag_packet(9)batadv_recv_bcast_packet(9)batadv_recv_mcast_packet(9)
like, the entire routing friend group showed up to the party ππ
mwah π that's the page! this lil gem lives in ./net/batman-adv and it's dated October 2026 β so yes, future-dated manpage energy, she's ahead of her time βπ¦ go forth and protect those windows, bestie π
π¦ 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