inet6_lookup_reuseport(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… inet6_lookup_reuseport(9) β€” like, the kernel API manual one, section 9 bestie ✨

okay so picture this: it's a Kernel API Manual page, section 9, and the whole thing is about inet6_lookup_reuseport β€” that's the function whose whole personality is "execute reuseport logic on AF_INET6 socket if necessary." slay. let's get into it πŸŽ€


✨ NAME ✨

inet6_lookup_reuseport β€” executes the reuseport logic on an AF_INET6 socket if necessary. lowkey does what it says on the tin, no notes πŸ’…


🌸 SYNOPSIS 🌸

struct sock * inet6_lookup_reuseport (const struct net *net , struct
sock *sk , struct sk_buff *skb , int doff , const struct in6_addr *saddr
, __be16 sport , const struct in6_addr *daddr , unsigned short hnum ,
inet6_ehashfn_t *ehashfn );

like yes that's a lot of parameters, but she ate and left no crumbs πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • net β€” the network namespace. that's her world, her main character setting ✨
  • sk β€” an AF_INET6 socket. important vibe check: it must be in TCP_LISTEN state for TCP, or TCP_CLOSE for UDP. no exceptions bestie, that's the rule 🚨
  • skb β€” the context for a potential SK_REUSEPORT program. it's giving "here's where the program might happen" 🫢
  • doff β€” the header offset. just an offset. iconic in its simplicity πŸ’œ
  • saddr β€” source address πŸ“¬
  • sport β€” source port πŸ”’
  • daddr β€” destination address πŸ“­
  • hnum β€” destination port, and bestie it's in host byte order β€” write that down, that detail matters fr fr πŸ“
  • ehashfn β€” the hash function used to generate the fallback hash. the fallback hash's fallback bestie, we love a safety net 🌈

⭐ RETURN ⭐

so what comes back? two possibilities, and honestly both are valid:

  • NULL if sk doesn't have SO_REUSEPORT set 😭 (like it literally didn't opt in, so)
  • otherwise, a pointer to the selected sock or an error πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./net/ipv6/inet6_hashtables.c β€” go read her, she's got the lore πŸ“–βœ¨

πŸ’€ reminder bestie: the state requirements on sk are not a suggestion β€” TCP_LISTEN for TCP, TCP_CLOSE for UDP. don't be the person who ignores it πŸ™ˆ

and that's the whole page 🧚 from ./net/ipv6, dated October 2026 β€” mwah, periodt, inet6_lookup_reuseport(9) out πŸ’–

πŸ“¦ where this page comes from