iptfs_encap_add_ipv4(9)
π¦ iptfs_encap_add_ipv4(9) β like, the whole glow-up, bestie π¦
okay so this is a page from the Kernel API Manual, and the function we're obsessing over today is iptfs_encap_add_ipv4. yes it's a 9-section manual page, yes it's a kernel function, and yes we're gonna make it make sense. periodt. π
β¨ NAME β¨
iptfs_encap_add_ipv4 β adds the outer encaps. that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
int iptfs_encap_add_ipv4 (struct xfrm_state *x , struct sk_buff *skb );
like, it takes two things and hands you back an int. iconic signature tbh. π«Ά
β¨ ARGUMENTS β¨
xβ the xfrm state. your main character struct, fr.skbβ the packet. the actual little guy we're working with. π
β¨ DESCRIPTION β¨
okay so storytime π§ β this function was originally taken from xfrm4_tunnel_encap_add. and the reason for the copy? literally because IP-TFS/AGGFRAG can have different functionality for how to set the TOS/DSCP bits. different needs, different function, no cap.
so what does it actually do? it sets the protocol to a different value, and it doesn't do anything with inner headers β because those inner headers aren't pointing into a normal IP singleton inner packet. so likeβ¦ there's nothing there to touch, bestie. not applicable. we leave them alone. π
lowkey important: the "doesn't do anything with inner headers" part is by design, not a bug. don't come for her.
β¨ RETURN β¨
0on success π- a negative error code on failure π
that's the whole return contract. zero is the slay outcome.
β¨ SEE ALSO β¨
okay so the related-reading list is long and honestly kind of iconic. buckle up π
- Kernel file
./net/xfrm/xfrm_iptfs.c IPTFS_DEFAULT_DROP_TIME_USECS(9)IPTFS_DEFAULT_REORDER_WINDOW(9)IPTFS_DEFAULT_INIT_DELAY_USECS(9)IPTFS_DEFAULT_MAX_QUEUE_SIZE(9)struct xfrm_iptfs_config(9)struct xfrm_iptfs_data(9)iptfs_alloc_skb(9)iptfs_skb_head_to_frag(9)struct iptfs_skb_frag_walk(9)iptfs_skb_prepare_frag_walk(9)iptfs_skb_can_add_frags(9)iptfs_skb_add_frags(9)iptfs_pskb_add_frags(9)iptfs_pskb_extract_seq(9)iptfs_input_save_runt(9)__iptfs_iphlen(9)__iptfs_iplen(9)iptfs_complete_inner_skb(9)iptfs_reassem_abort(9)iptfs_reassem_done(9)iptfs_reassem_cont(9)iptfs_input_ordered(9)iptfs_drop_timer(9)iptfs_input(9)iptfs_enqueue(9)iptfs_copy_create_frag(9)iptfs_copy_create_frags(9)iptfs_first_skb(9)iptfs_encap_add_ipv6(9)iptfs_prepare_output(9)__iptfs_get_inner_mtu(9)iptfs_get_inner_mtu(9)iptfs_user_init(9)
like, go read them. iykyk. πβ¨
and that's the page!! π this little beauty lives in ./net/xfrm and the version/date stamp on it is October 2026 β so yeah, she's from the future, we don't ask questions πβ¨ mwah, go forth and encapsulate responsibly π¦π
π¦ 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