ip6_sk_dst_lookup_flow(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” whether sk is connected or not. a little bool that 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 🧚

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