inet_lookup_reuseport(9)
π inet_lookup_reuseport(9) π
Okay so bestie, welcome to the inet_lookup_reuseport page from the Kernel API Manual β this is the one that handles the reuseport logic on an AF_INET socket if it's necessary. Like, only if it needs to. Not out here doing extra work for no reason. β¨
πΈ SYNOPSIS πΈ
struct sock * inet_lookup_reuseport (const struct net *net , struct sock
*sk , struct sk_buff *skb , int doff , __be32 saddr , __be16 sport ,
__be32 daddr , unsigned short hnum , inet_ehashfn_t *ehashfn );
Yeah, it's a whole long signature. Nine arguments. She's got a lot going on but she's iconic for it. π
π¦ ARGUMENTS π¦
netβ the network namespace. the whole vibe container basically.skβ theAF_INETsocket. Heads up though: it must be inTCP_LISTENstate for TCP, orTCP_CLOSEfor UDP. Non-negotiable, bestie. πskbβ the context for a potentialSK_REUSEPORTprogram.doffβ the header offset.saddrβ source address.sportβ source port.daddrβ destination address.hnumβ destination port, but in host byte order. yes that matters. πehashfnβ the hash function used to generate the fallback hash. the backup plan, the understudy, the fallback queen. π
β RETURN β
So what does she give you back?
NULLβ ifskdoesn't haveSO_REUSEPORTset. like, no reuseport, no results, sorry babe π- otherwise β a pointer to the selected sock, or an error. that's the range. that's the answer. π₯
ngl this one's short but she's important, so don't sleep on the state requirements forsk. thatTCP_LISTEN/TCP_CLOSEthing is a real vibe check. π
π§ SEE ALSO π§
Kernel file ./net/ipv4/inet_hashtables.c β go read her, she's serving the actual source realness. π«Ά
kisses and good vibes from ./net/ipv4 β that's the source directory, and the date stamp says October 2026 π mwah, go slay your socket lookups π¦β¨
π¦ 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