batadv_forw_packet_steal(9)
π 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 visibilitylockβ 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
- 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