batadv_get_vid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 via pskb_may_pull/... so like, any pointer into the skb data (think: whatever you grabbed from skb->data or eth_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:


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