inet_sk_get_...l_port_range(9)
π inet_sk_get_local_port_range β NAME
okay so bestie, this is inet_sk_get_local_port_range β it fetches the ephemeral ports range. that's it, that's the whole vibe β¨ (and yeah, we're in the Kernel API Manual, section 9, iykyk π)
β¨ SYNOPSIS β¨
bool inet_sk_get_local_port_range (const struct sock *sk , int *low ,
int *high );
likeβ¦ it literally returns a bool, no cap π«Ά
π¦ ARGUMENTS π¦
skβ the socket πlowβ pointer to low port πhighβ pointer to high port πΈ
π DESCRIPTION π
so here's the tea, bestie: this function fetches the netns port range β and that's /proc/sys/net/ipv4/ip_local_port_range for those of you taking notes πβ¨
and the range can be overridden if the socket got the IP_LOCAL_PORT_RANGE option set π like, the socket said "not today" to the default and chose its own range, periodt.
it returns true if IP_LOCAL_PORT_RANGE was set on this socket π― that's the whole return-value situation, no surprises, fr fr π
π SEE ALSO π
- Kernel file
./net/ipv4/inet_connection_sock.cπ inet_csk_clone_lock(9)π§
and that's the post π this lil' page lives in ./net/ipv4, dated October 2026, and its manual title is inet_sk_get_...l_port_range(9) β mwah, go forth and range responsibly π«Άπ
π¦ 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