batadv_get_vid(9)
β¨ batadv_get_vid(9) β the Kernel API Manual glow-up β¨
okay so bestie, welcome to the batadv_get_vid page from the Kernel API Manual π
this one is short but it's lowkey important, so grab your iced coffee and let's get into it π
πΈ NAME πΈ
batadv_get_vid β literally just pulls the VLAN identifier out of the skb, if there even is one π¦
π SYNOPSIS π
unsigned short batadv_get_vid (struct sk_buff *skb , size_t header_len );
like, that's the whole signature, she's cute, she's compact π
π ARGUMENTS π
skbβ the buffer that's holding the packet π«Άheader_lenβ how long the batman header is, the one sitting right before the ethernet header π
β DESCRIPTION β
so here's the tea β β the caller has to make sure that at least header_len + ETH_HLEN bytes are actually accessible after skb->data. that's on you, not on her, okay? π
β οΈ WARNING, and I mean this fr fr β this function may reallocate the skb data buffer viapskb_may_pull/... so like, any pointer into the skb data (think: whatever you grabbed fromskb->dataoreth_hdr) that you had before this call? consider it invalid afterwards π it has to be reacquired, no cap. do not keep using the old one, she is gone πͺ¦
π¦ RETURN π¦
she gives you back the VID with the BATADV_VLAN_HAS_TAG flag when the packet embedded in the skb is vlan tagged π
otherwise it's BATADV_NO_FLAGS, and that's that πΈ
π SEE ALSO π
Kernel file ./net/batman-adv/main.c and honestly the whole friend group:
batadv_init(9)batadv_exit(9)batadv_mesh_init(9)batadv_mesh_free(9)batadv_is_my_mac(9)batadv_max_header_len(9)batadv_skb_set_priority(9)batadv_recv_unhandled_packet(9)batadv_batman_skb_recv(9)batadv_recv_handler_init(9)batadv_recv_handler_register(9)batadv_recv_handler_unregister(9)batadv_vlan_ap_isola_get(9)batadv_throw_uevent(9)
and that's the page!! π₯³ source is ./net/batman-adv, dated October 2026 β go be iconic with your skb pointers, bestie, and remember: reacquire after the pull or it's giving undefined πβ¨π«Ά
π¦ 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