__vlan_insert_tag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __vlan_insert_tag β€” regular VLAN tag inserting πŸŽ€

okay bestie, so this one is a kernel API manual page (section 9, the kernel API one, iykyk) and honestly? it's giving "small function, big job" πŸ’… let's get into it.


🌸 SYNOPSIS 🌸

int __vlan_insert_tag (struct sk_buff *skb , __be16 vlan_proto , u16
vlan_tci );

literally just one call, three things in, an int out. iconic behavior 🫢


πŸ’– ARGUMENTS πŸ’–

  • skb β€” the skbuff you're tagging, bestie. this is the one getting the glow-up ✨
  • vlan_proto β€” the VLAN encapsulation protocol. that's the __be16 one, don't mix it up πŸ™ˆ
  • vlan_tci β€” the VLAN TCI to insert. it's a u16, so keep it in its lane πŸŽ€

🌈 DESCRIPTION 🌈

So what does it do? It inserts the VLAN tag into skb as part of the payload πŸ“¦ β€” that part matters, ok?

And the key detail, no cap: it does not change skb->protocol, which is exactly why this function can be used during receive πŸ”₯ like, that's the whole point of the underscore-prefix version, iykyk.


⭐ RETURN ⭐

Returns an error if skb_cow_head fails. that's it, that's the deal πŸ’€

Heads up bestie: if skb_cow_head fails, you get an error back β€” so check that return value, fr fr πŸ™

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file for all this lives at ./include/linux/if_vlan.h, and here's the whole friend group πŸ‘‘ :

like, that's a whole squad πŸ§šπŸ’œ


okay that's the page!! this one comes to you from the kernel API manual, source path ./include/linux, dated October 2026 🌸 β€” and that's the whole __vlan_insert_tag(9) situation, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from