udp_tunnel6_dst_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 device
  • sk β€” Socket which provides route info
  • oif β€” Index of the output interface
  • saddr β€” Memory to store the src ip address. yes bestie, she writes into this β€” it's an out-param ✨
  • key β€” Tunnel information
  • sport β€” UDP source port
  • dport β€” UDP destination port
  • dsfield β€” The traffic class field
  • dst_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