batadv_forw_packet_steal(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– batadv_forw_packet_steal(9) πŸ’–

okay bestie, welcome to the Kernel API Manual, and today's main character is batadv_forw_packet_steal β€” no cap, this one's a little heist movie and it's literally so fun πŸŽ€


✨ NAME ✨

batadv_forw_packet_steal β€” claim a forw_packet for free()

like. we're snatching it. for the free. that's the whole gig πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool batadv_forw_packet_steal (struct batadv_forw_packet *forw_packet ,
spinlock_t *lock );

it returns a bool, it takes a struct batadv_forw_packet * and a spinlock_t *, and yes the spacing is exactly like that, don't @ me 🌸


🌈 ARGUMENTS 🌈

  • forw_packet β€” the forwarding packet to steal 🫢 this is your target, your prize, the thing you're liberating from global visibility
  • lock β€” a key to the store you're stealing from, like, for real, e.g. forw_{bat,bcast}_list_lock πŸ”‘

iykyk β€” that {bat,bcast} is a literal brace expansion in the name, both locks exist, don't get it twisted ⭐


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the vibe. this function tries to steal a specific forw_packet out of global visibility, and the reason it's doing that is so the caller can get it free()d. that's it, that's the mission πŸ’€

⚠️ but bestie, listen to me: that means the caller is *not* allowed to requeue it afterwards. like, at all. ever. it's gone from the list, it's yours to destroy, do not put it back. that's the deal, periodt.

so the whole point is: once you've stolen it, nobody else can see it, and you're the one responsible for its graceful little exit πŸ”₯ not me being dramatic, that's literally what the manpage says.


πŸ’œ RETURN πŸ’œ

  • True β€” stealing was successful, you ate, the packet is yours πŸŽ‰
  • False β€” someone else stole it before us 😭 rip, the heist failed, they got there first

🌟 SEE ALSO 🌟

Kernel file ./net/batman-adv/send.c β€” and like, the whole extended friend group:

batadv_send_skb_packet(9), batadv_send_broadcast_skb(9), batadv_send_unicast_skb(9), batadv_send_skb_to_orig(9), batadv_send_skb_push_fill_unicast(9), batadv_send_skb_prepare_unicast(9), batadv_send_skb_prepare_unicast_4addr(9), batadv_send_skb_unicast(9), batadv_send_skb_via_tt_generic(9), batadv_send_skb_via_gw(9), batadv_forw_packet_free(9), batadv_forw_packet_alloc(9), batadv_forw_packet_was_stolen(9), batadv_forw_packet_list_steal(9), batadv_forw_packet_list_free(9), batadv_forw_packet_queue(9), batadv_forw_packet_bcast_queue(9), batadv_forw_packet_ogmv1_queue(9), batadv_forw_bcast_packet_to_list(9), batadv_forw_bcast_packet_if(9), batadv_send_no_broadcast(9), __batadv_forw_bcast_packet(9), batadv_forw_bcast_packet(9), batadv_send_bcast_packet(9), batadv_forw_packet_bcasts_left(9), batadv_forw_packet_bcasts_dec(9), batadv_forw_packet_is_rebroadcast(9), batadv_send_outstanding_bcast_packet(9), batadv_purge_outstanding_packets(9)


and that's the tea β˜• β€” this page lives in ./net/batman-adv, dated October 2026, in the Kernel API Manual, and honestly? iconic πŸ’–βœ¨ go steal responsibly, bestie 🧚

πŸ“¦ where this page comes from