vlan_insert_tag_set_proto(9)
π 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
skbon success π NULLon error β andskbis 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 β¨
struct vlan_ethhdr(9)struct vlan_pcpu_stats(9)struct vlan_priority_tci_mapping(9)struct vlan_dev_priv(9)eth_type_vlan(9)__vlan_insert_inner_tag(9)__vlan_insert_tag(9)vlan_insert_inner_tag(9)vlan_insert_tag(9)__vlan_hwaccel_clear_tag(9)__vlan_hwaccel_copy_tag(9)__vlan_hwaccel_put_tag(9)__vlan_get_tag(9)__vlan_hwaccel_get_tag(9)vlan_get_tag(9)vlan_get_protocol_offset_inline(9)vlan_get_protocol(9)vlan_remove_tag(9)skb_vlan_tagged(9)skb_vlan_tagged_multi(9)vlan_features_check(9)compare_vlan_header(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms