This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [] libc/1172: rresvport should avoid well known ports


On Tue, Jun 29, Rod m. Stewart wrote:

> On Mon, 28 Jun 1999, Han Holl wrote:
> > On Mon, Jun 28, 1999 at 09:34:39AM +0200, Thorsten Kukuk wrote:
> > > 
> > > You make one mistake: You looked at the RedHats /etc/services version.
> > > This means, on RedHat 17 ports out of 424 are used. But RedHats
> > > version is not an official one.
> > > 
> > Of course each system administrator _knows_ which services he runs.
> > Systems running obscure services wil have administrators who know
> > how to edit /etc/services, so as to let enough port free for
> > dynamically assigned ports. I didn't propose to avoid all reserved ports,
> > but all reserved ports that are actually configured in /etc/services.
> > 
> > > Look at RFC 1700, nearly all ports are reserved for a service. 
> Just one comment.  Please disregard it if it is not feasible.  Would it be
> possible to first try to get a reserved port which is not in set in
> /etc/services, then if it fails (none available) fall back on the current
> behaviour.
> Or is would this add in too much over head, or I may have misunderstood
> the question/problem.

The problem is: You get a port from bind and after this you could check
if it is in /etc/services or not. Means, you need a lot of tries if there
are only a few free. How many tries to you need if there is no port free ?

To search for free ports in /etc/services and try this is also very
slow. With the current, "official" services file you need 0.05 seconds
for searching an entry in it. Make 20 queries for searching an unused
port, and you need 1 second for it (PII/400). Then use NIS and do
a query for all entries in a map (initgroups() makes this). You will
need far to long for it.


Thorsten Kukuk
SuSE GmbH           Schanzaeckerstr. 10             90443 Nuernberg
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]