ipv4 bind()ing bug

Paul H. Hargrove (hargrove@sccm.Stanford.EDU)
Thu, 11 Sep 1997 16:51:23 -0700 (PDT)


First off, sorry if this problem is known and will be fixed in 2.0.31.
I try to keep up with the list, but find it impossible to read every
message.

The problem occurs when a UDP or TCP socket has a local port number of
zero. Normal un*x behavior is to assign a "random" port number
between IPPORT_RESERVED (1024) and IPPORT_USERRESERVED (5000). Linux,
however, assigns a port number between 1024 and 32767. This can be a
problem, for instance, if X starts up and port 6000 is bound by
something else. There are a number of servers out there that assume
they can bind to a port number above 5000 without conflicting with the
randomly assigned ports. That is, after all, the purpose of
IPPOR_USERRESERVED. This can also screw with firewalls and packet
filters which assume normal clients only use port numbers in the
1024-5000 range.

-- 
Paul H. Hargrove                   All material not otherwise attributed
hargrove@sccm.stanford.edu         is the opinion of the author or a typo.