ip6_tnl_locate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 for
  • create β€” literally != 0 if 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 🌈


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