Subject: bin/3341: inetd fails after connection from localhost
To: None <gnats-bugs@gnats.netbsd.org>
From: None <martin@rumolt.teuto.de>
List: netbsd-bugs
Date: 03/17/1997 20:39:33
>Number:         3341
>Category:       bin
>Synopsis:       after a tcp_wrapper warning inetd fails permanently
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 17 11:50:02 1997
>Last-Modified:
>Originator:     Martin Husemann
>Organization:
private

>Release:        current as of Mar 16
>Environment:
	
System: NetBSD rumolt.teuto.de 1.2C NetBSD 1.2C (RUMOLT) #0: Mon Mar 17 19:57:05 MET 1997 root@rumolt.teuto.de:/usr/src/sys-isdn/arch/i386/compile/RUMOLT i386


>Description:

With a sup -voz from yesterday, make from real clean build directory, 
everything installed, fresh compiled kernel, etc. I get this:

Mar 17 20:01:05 rumolt /netbsd: biomask 840 netmask 1c40 ttymask 1c5a
Mar 17 20:01:05 rumolt /netbsd: boot device: sd0
Mar 17 20:01:05 rumolt /netbsd: root file system type: ffs
Mar 17 20:01:11 rumolt dhcpd: Listening on BPF/ed0/0:0:c0:11:48:2d/194.77.123.128
Mar 17 20:01:11 rumolt dhcpd: Sending on   BPF/ed0/0:0:c0:11:48:2d/194.77.123.128
Mar 17 20:01:11 rumolt dhcpd: Sending on   Socket/fallback/fallback-net
Mar 17 20:01:44 rumolt inetd[261]: warning: can't get client address: Socket is not connected
Mar 17 20:01:44 rumolt identd[262]: Connection from localhost
Mar 17 20:01:47 rumolt identd[265]: Connection from localhost
Mar 17 20:01:51 rumolt identd[268]: Connection from localhost
Mar 17 20:02:52 rumolt inetd[134]: select: Bad file descriptor
Mar 17 20:03:23 rumolt last message repeated 31 times

After a few connections to localhost (SMTP delivery to sendmail, 
telnet localhost, ...) inetd fails. First, a child process logs
"warning: can't get client address: Socket is not connected", which is
from lib/libwrap sock_host (called by "fromhost" from inetd), meaning that
a getpeername() failed and a recvfrom(... PEEK...) failed to. In this case
(all tcp stream connections) the getpeername should have worked in the
first place. Then, a short time or/and a few connections from localhost 
later, the parent inetd begins to log "select: Bad file descriptor" and
after that even "telnet localhost" won't work. This is not too bad, but
telnet from other hosts to the local machine doesn't work either!

>How-To-Repeat:

Boot a -current system, have some SMTP/telnet connections from/to localhost.

>Fix:

n/a - sorry.
>Audit-Trail:
>Unformatted: