ip6_tnl_locate(9)
π ip6_tnl_locate β kernel API manual, bestie edition π
okay so this is ip6_tnl_locate(9) straight out of the Kernel API Manual, and honestly? it's giving "find or create tunnel matching given parameters" and I am obsessed π¦ the way this little function just goes and hunts down a tunnel for you, and if it can't find one it might just build you a brand new one?? main character energy fr fr β¨
β¨ SYNOPSIS β¨
struct ip6_tnl * ip6_tnl_locate (struct net *net , struct __ip6_tnl_parm
*p , int create );
that's the whole vibe right there π
π ARGUMENTS π
netβ the network namespace bestie, that's the world it's looking in πpβ the tunnel parameters, aka the description of the tunnel we're hunting forcreateβ literally!= 0if you're allowed to create a new tunnel when no match is found π like, permission to slay
πΈ DESCRIPTION πΈ
So here's the tea β ip6_tnl_locate first tries to locate an existing tunnel based on parms. Very demure, very mindful β it checks what's already there first π
If that's a flop and it doesn't find anything, but create is set, then a new tunnel device gets created and registered for use. boom. new tunnel, brand new, periodt π
β¨
no cap, if create is not set you don't get a new tunnel. the function isn't out here inventing devices behind your back, iykyk π«Ά
β RETURN β
matching tunnel or error pointer π (so like, check it. always check it. don't be that girl.)
π¦ SEE ALSO π¦
the kernel file is ./net/ipv6/ip6_tunnel.c and here's the whole squad, no gatekeeping π
ip6_tnl_lookup(9)ip6_tnl_bucket(9)ip6_tnl_link(9)ip6_tnl_unlink(9)ip6_tnl_create(9)ip6_tnl_dev_uninit(9)ip6_tnl_parse_tlv_enc_lim(9)ip6_tnl_addr_conflict(9)ip6_tnl_xmit(9)ip6_tnl_change(9)ip6_tnl_siocdevprivate(9)ip6_tnl_change_mtu(9)ip6_tnl_dev_setup(9)ip6_tnl_dev_init_gen(9)ip6_tnl_dev_init(9)ip6_fb_tnl_dev_init(9)ip6_tunnel_init(9)ip6_tunnel_cleanup(9)
sign-off time π§π this page lives in ./net/ipv6, it's dated October 2026, and it's from the Kernel API Manual β go read the source bestie, it ate π₯π
π¦ 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