vlan_get_tag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vlan_get_tag(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're deep in kernel land, you've got an skb in your hands, and you just need to know its VLAN ID. that's literally this function. it's the "hey bestie what's your VLAN tag" of the networking stack, and yes it lives in the Kernel API Manual (that's the 9 on the end, iykyk).


✨ NAME ✨

vlan_get_tag β€” get the VLAN ID from the skb πŸŽ€

like, that's it. that's the whole job. you hand it a packet, it hands you the tag.


🌸 SYNOPSIS 🌸

int vlan_get_tag (const struct sk_buff *skb , u16 *vlan_tci );

look at her. two args, one int coming back at you. no cap. πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the skbuff you're querying πŸ‘€ this is the packet you're asking about, and it's const because we're just looking, not touching. respectfully.
  • vlan_tci β€” buffer to store the value 🫢 you pass in a u16 * and the answer gets dropped in there. it's giving "you provide the bucket, we provide the water".

πŸ”₯ RETURN πŸ”₯

returns an error if the skb is not VLAN tagged πŸ’€

so like, if your packet isn't tagged? error. that's the vibe check and your skb failed it. not me being dramatic, that's just what the manpage says, fr fr.


πŸ‘‘ SEE ALSO πŸ‘‘

grab a snack, this list is long, but honestly it's all her cousins and they're all iconic in their own way:

⭐ note the underscores, bestie β€” there's a whole double-underscore squad in there and they are NOT the same as the regular ones. do not confuse them, that's a whole different function and you will be sad. πŸ™ˆ

that's the whole page, you ate it up, no crumbs. πŸ’…

sign-off time: this little gem lives under ./include/linux, it's dated October 2026, and it goes by vlan_get_tag(9) β€” remember her name, she's main character energy. 🌈✨

πŸ“¦ where this page comes from