batadv_check_unicast_packet(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… batadv_check_unicast_packet(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this one's a little function from the kernel's batman-adv corner, and honestly it's giving security-guard-at-the-door energy ✨. It's literally just checking packets before anyone lets them in. Let's go 🫢


✨ NAME ✨

batadv_check_unicast_packet β€” check for malformed unicast packets πŸ•΅οΈβ€β™€οΈ

🌸 SYNOPSIS 🌸

int batadv_check_unicast_packet (struct batadv_priv *bat_priv , struct
       sk_buff *skb , int hdr_size );

πŸŽ€ ARGUMENTS πŸŽ€

  • bat_priv β€” the bat priv that's holding all the mesh interface information, like the group chat admin who knows every member 🫢
  • skb β€” the packet we're checking, the actual main character of this whole story πŸ“¦
  • hdr_size β€” size of the header to pull, i.e. how many bytes we're yoinking off the front πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it actually do? It checks for a short header and bad addresses in the given packet. That's it, that's the vibe check βœ…. If the header's too short or the addresses are sus, it's not passing β€” no cap.

πŸ’œ RETURN πŸ’œ

Here's the tea, and it's giving very specific negative values:

  • a negative value when the check fails β€” and which negative value depends on the reason πŸ‘€
  • 0 otherwise, aka everything's fine, we love to see it πŸ’–

The negative values, one by one, because every reason has its own little label:

  • -ENODATA β€” for a bad header πŸ™ˆ
  • -EBADR β€” for a broadcast destination or source, which is lowkey not what we asked for πŸ“’
  • -EREMOTE β€” for a non-local (other host) destination, like it's cute but it's not ours 🚫

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/batman-adv/routing.c and its whole friend group (this is a long list, bestie, but we're not skipping a single one, periodt):


okay that's the whole page, ily for reading it all πŸ’• sign-off time: this one lives in ./net/batman-adv, it's dated October 2026, and it's page batadv_check_unicast_packet(9) of the Kernel API Manual β€” stamped and delivered πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from