batadv_window_protected(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to true if 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 through
  • true β†’ 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:

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