From owner-freebsd-hackers Sun Jun 13 8: 1:30 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 384CC14D22 for ; Sun, 13 Jun 1999 08:01:27 -0700 (PDT) (envelope-from green@unixhelp.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id LAA26460; Sun, 13 Jun 1999 11:01:26 -0400 (EDT) Date: Sun, 13 Jun 1999 11:01:26 -0400 (EDT) From: Brian Feldman X-Sender: green@janus.syracuse.net To: Dag-Erling Smorgrav Cc: hackers@FreeBSD.ORG Subject: Re: select(2) breakage In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 13 Jun 1999, Dag-Erling Smorgrav wrote: > Brian Feldman 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. Actually, this is the perfect explanation. I think that this should go in the FAQ. Why in the world are we limiting the ports we can use other than from 1-1023? > > 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 > Brian Feldman _ __ ___ ____ ___ ___ ___ green@unixhelp.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.freebsd.org _ |___/___/___/ " THAT'S WRONG WRONG WRONG!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message