__vlan_insert_inner_tag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to the __vlan_insert_inner_tag(9) page from the Kernel API Manual β€” it's literally about inner VLAN tag inserting, and yes that's the whole name. iconic. πŸ’…


✨ SYNOPSIS ✨

the signature is exactly this, no cap:

int __vlan_insert_inner_tag (struct sk_buff *skb , __be16 vlan_proto ,
u16 vlan_tci , unsigned int mac_len );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the skbuff you're tagging, bestie 🫢
  • vlan_proto β€” the VLAN encapsulation protocol, periodt.
  • vlan_tci β€” the VLAN TCI to insert, lowkey important.
  • mac_len β€” MAC header length including outer vlan headers β€” don't forget the outer vlan headers, iykyk πŸ’…

🌸 DESCRIPTION 🌸

so the way this works is: it inserts the VLAN tag into skb as part of the payload at offset mac_len. that's the move. ✨

and it does not change skb->protocol, so this function can be used during receive. main character energy for receive paths, honestly. πŸ¦‹


πŸ’… RETURN πŸ’…

it returns an error if skb_cow_head fails. that's the return vibe β€” if skb_cow_head fails, you get an error, and that's on periodt. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go touch grass in the Kernel file ./include/linux/if_vlan.h, and also peek at the whole friend group:


okay bye bestie! πŸ’– source/version: ./include/linux Β· date: October 2026 Β· page: __vlan_insert_inner_tag(9) πŸŽ€βœ¨

πŸ“¦ where this page comes from