lkml.org 
[lkml]   [1998]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-2.1.98 bind returns EAGAIN: bandaid fix
   From: "Adam J. Richter" <adam@yggdrasil.com>
Date: Sat, 2 May 1998 09:18:35 -0700

Telnet and FTP would fail, and ptrace revealed that these program
would always get the error EAGAIN from the bind(2) system call. It
turns out that this was caused by tcp_good_socknum() in
linux-2.1.98/net/ipv4/tcp_ipv4.c failing to find an available
socket number, even though only a very small number of sockets were
in use on the system. Somehow, every available socket number had a
tcp_bind_bucket associated with it, but that bucket would have a
null "owners" field. Anyhow, putting a call to tcp_bucketgc() at
the begining of tcp_good_socknum() made the problem go away, but I
am sure that that is not exactly right fix, since the point in
having a hashing scheme is to go fast.

And it will also corrupt the TCP SLT timer count into a negative
value, that is if the timer is not going off when it should...

Actually, this should never happen. Every time the last socket for a
local port is destroyed, tcp_sk_unbindify() notices that tb->owners is
now NULL, and schedules the TCP_SLT_BUCKETGC timer to go off. When it
does, if some new socket has not attached itself to the bind bucket,
the bucketgc routine will reap it.

If this would not happen, everyone would get a locked system after a
while, I'd like a lot more information on this if possible, as the
code in question has not changed in 2 months and this is the first
report of it's kind I've ever seen reported.

Also, have any adjustments to /proc/sys/net/ipv4/ip_local_port range
been made on this box, and also is it doing masquerading or
transparent proxying? I'd also be interested if the problem goes away
in 2.1.99... although I have a batch of fixes for that going in right
now.

Later,
David S. Miller
davem@dm.cobaltmicro.com



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.585 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site