vlan_insert_tag_set_proto(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– vlan_insert_tag_set_proto(9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the kernel API manual page for vlan_insert_tag_set_proto β€” she's giving "regular VLAN tag inserting" and honestly she ate ✨


🌸 NAME 🌸

vlan_insert_tag_set_proto β€” regular VLAN tag inserting πŸŽ€ (yes, "regular" β€” she's not doing anything extra, she's just doing her job)


πŸ¦‹ SYNOPSIS πŸ¦‹

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

like literally that's the whole signature, copy it exactly please, no typos, slay πŸ’…


πŸ’œ ARGUMENTS πŸ’œ

  • skb β€” the skbuff you're tagging, that's her, that's the main character 🫢
  • vlan_proto β€” the VLAN encapsulation protocol (which flavor of VLAN vibes we're working with) 🌈
  • vlan_tci β€” the VLAN TCI you want to insert, the actual goods πŸ’–

✨ DESCRIPTION ✨

So what she does: she inserts the VLAN tag into skb as part of the payload, and hands you back a VLAN tagged skb. no cap πŸŽ€

⚠️ heads up bestie β€” this might change skb->head. so don't be out here holding onto pointers into that memory like it's a fixed address, because it is not πŸ’€

Then we get the error-handling lore. Following the skb_unshare example, in case of error, the calling function doesn't have to worry about freeing the original skb. so you don't have to do the cleanup girlboss dance yourself, she's got it 😭🫢


πŸ”₯ RETURN πŸ”₯

  • modified skb on success πŸŽ‰
  • NULL on error β€” and skb is freed in that case πŸ’€

so yeah, check your return value. NULL means the skb is gone-gone, don't touch her πŸ™ˆ


🧚 SEE ALSO 🧚

Kernel file ./include/linux/if_vlan.h β€” that's where all her friends live ✨

the whole friend group, iconic πŸ‘‘ (and there's a lot of them, iykyk)


that's the page bestie!! πŸ“ this one's out of ./include/linux, dated October 2026, and she's the vlan_insert_tag_set_proto(9) page πŸ’…βœ¨ go tag some skbs, you've got this πŸ«ΆπŸ’–

πŸ“¦ where this page comes from