udp_tunnel6_dst_lookup(9)
β¨ udp_tunnel6_dst_lookup(9) β¨
okay so bestie, welcome to the Kernel API Manual β this one's a kernel function, udp_tunnel6_dst_lookup(9), and it's literally the vibe check your UDP tunnel does before it commits to a route. no cap. π¦
πΈ NAME πΈ
udp_tunnel6_dst_lookup β perform route lookup on UDP tunnel
like, that's the whole job description and she ate π
π SYNOPSIS π
struct dst_entry * udp_tunnel6_dst_lookup (struct sk_buff *skb , struct
net_device *dev , struct net *net , struct sock *sk , int oif , struct
in6_addr *saddr , const struct ip_tunnel_key *key , __be16 sport ,
__be16 dport , u8 dsfield , struct dst_cache *dst_cache );
she returns a struct dst_entry * and takes eleven arguments, which is honestly a lot of arguments but okay periodt π«Ά
π ARGUMENTS π
skbβ Packet for which lookup is done. the little packet that's getting its route figured out π¦devβ Tunnel device πnetβ Network namespace of tunnel deviceskβ Socket which provides route infooifβ Index of the output interfacesaddrβ Memory to store the src ip address. yes bestie, she writes into this β it's an out-param β¨keyβ Tunnel informationsportβ UDP source portdportβ UDP destination portdsfieldβ The traffic class fielddst_cacheβ The dst cache to use for lookup. This function performs a route lookup on a UDP tunnel π
π§ DESCRIPTION π§
okay so here's the tea β on success it returns a valid dst pointer and stores the src address to be used in the tunnel in the param saddr. if it's not a success? it hands you back a pointer encoded error code instead. so like, check your vibes before you dereference, iykyk π
bestie pls remember: the error comes back as a pointer encoded error code, not a plain NULL. do not just casually deref it, that's giving undefined behaviour and we don't do that here π
π₯ SEE ALSO π₯
- Kernel file
./net/ipv6/ip6_udp_tunnel.c
go read the source, she's iconic β
and that's the whole page, bestie β mwah π this one's from ./net/ipv6, dated October 2026, and she's filed under udp_tunnel6_dst_lookup(9). slay π
π¦ 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