Skip site navigation (1)Skip section navigation (2)
Date:      13 Jun 1999 13:22:30 +0200
From:      Dag-Erling Smorgrav <des@flood.ping.uio.no>
To:        Brian Feldman <green@unixhelp.org>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: select(2) breakage
Message-ID:  <xzpu2scxs3t.fsf@flood.ping.uio.no>
In-Reply-To: Brian Feldman's message of "Sun, 13 Jun 1999 00:44:50 -0400 (EDT)"
References:  <Pine.BSF.4.10.9906130033380.17648-100000@janus.syracuse.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Feldman <green@unixhelp.org> writes:
>   Another problem that came up with this: I originally started at port 1024.
> I monopolized 30000 ports (almost all consecutive, of course). When I try to
> connect() a TCP socket as non-root, it fails with EAGAIN (I only tracked it
> far enough down as in_pcbbind().) It seems that eventually it gives up trying
> to find a port... :-/

What kind of connects are you doing? If you try to connect all your
sockets to the same destination,port tuple you'll quickly run out of
source ports, since there are only a little less than 4,000 ports
available:

des@des ~% sysctl -A | grep portrange
net.inet.ip.portrange.lowfirst: 1023
net.inet.ip.portrange.lowlast: 600
net.inet.ip.portrange.first: 1024
net.inet.ip.portrange.last: 5000
net.inet.ip.portrange.hifirst: 49152
net.inet.ip.portrange.hilast: 65535

connect() normally uses the 1024-5000 range. Try the following:

# sysctl -w net.inet.ip.portrange.last=40000

and see if it solves the EAGAIN problem.

DES
-- 
Dag-Erling Smorgrav - des@flood.ping.uio.no


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpu2scxs3t.fsf>