ip6_sk_dst_lookup_flow(9)
π ip6_sk_dst_lookup_flow(9) β like, the Kernel API Manual entry you actually wanna read β¨
okay so bestie, welcome to the glow-up of ip6_sk_dst_lookup_flow(9) from the Kernel API Manual. this is the function that does a socket-cached route lookup on a flow, and honestly? it's giving main character energy in net/ipv6. let's get into it π
β¨ NAME β¨
ip6_sk_dst_lookup_flow β performs a socket cached route lookup on a flow π«
like literally, that's the whole vibe. socket. cached route. flow. slay.
πΈ SYNOPSIS πΈ
struct dst_entry * ip6_sk_dst_lookup_flow (struct sock *sk , struct
flowi6 *fl6 , const struct in6_addr *final_dst , bool connected );
no cap, that's the exact signature β don't @ me, copy it character for character π«Ά
π¦ ARGUMENTS π¦
skβ the socket that provides the dst cache and route info. she's the one holding the goods πfl6β the flow to lookup. this is what we're out here looking up, periodt.final_dstβ the final destination address, specifically for the ipsec lookup. iykyk π₯connectedβ whetherskis connected or not. a littleboolthat changes everything, ngl.
π DESCRIPTION π
so here's the tea β β this function performs a route lookup on the given flow, with the possibility of using the cached route in the socket if it is valid. she's efficient like that π
it will take the socket dst lock when operating on the dst cache. and because of that lock situation:
β οΈ as a result, this function can only be used in process context. do not try this from anywhere else, bestie, i'm serious π
in addition (and this is the cute extra bit π), for a connected socket, it caches the dst in the socket if the current cache is not valid. very "if it doesn't fit, fix it" of her.
and what does it return? a valid dst pointer on success π β or a pointer encoded error code π. like, it's either a win or an error hidden inside a pointer. choose your fighter.
π§ SEE ALSO π§
- Kernel file
./net/ipv6/ip6_output.cip6_dst_lookup(9) ip6_dst_lookup_flow(9)
go read those too fr fr, they're the supporting cast and they ate β¨
and that's the whole page, bestie β no notes, she's iconic π
this little sign-off comes straight from ./net/ipv6, dated October 2026 β catch you on the next lookup, mwah ππ
π¦ 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