inet_sk_get_...l_port_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🌈


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