From owner-freebsd-hackers Mon Jun 8 18:36:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA23591 for freebsd-hackers-outgoing; Mon, 8 Jun 1998 18:36:05 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (root@smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA23535 for ; Mon, 8 Jun 1998 18:35:53 -0700 (PDT) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id SAA23805; Mon, 8 Jun 1998 18:10:34 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp04.primenet.com, id smtpd023625; Mon Jun 8 18:10:21 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id SAA22672; Mon, 8 Jun 1998 18:10:10 -0700 (MST) From: Terry Lambert Message-Id: <199806090110.SAA22672@usr07.primenet.com> Subject: Re: ECONNREFUSED on a READ? To: rminnich@Sarnoff.COM (Ron G. Minnich) Date: Tue, 9 Jun 1998 01:10:10 +0000 (GMT) Cc: luoqi@watermarkgroup.com, avalon@coombs.anu.edu.au, hackers@FreeBSD.ORG, nate@mt.sri.com In-Reply-To: from "Ron G. Minnich" at Jun 8, 98 03:58:39 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > 5606 telnet CALL socket(0x2,0x2,0) > > UDP socket > > OK, telnet is more of a mess than I thought. I just realized the same > thing. > > So what piece of code (telnet, libtelnet, libc, ...) is creating a dgram > socket and then trying to do a connect()? does that make any sense? I > don't have the whole source tree handy. anybody want to look? This looks > like part of dns client code from the trace. gethostbyname(). > > > 5606 telnet CALL recvfrom(0x3,0xefbfd884,0x400,0,0xefbfce10,0xefbfcd7c) > > > 5606 telnet RET recvfrom -1 errno 61 Connection refused > > ECONNREFUSED here simply means there's no socket bound at the destination > > address/port. Probably you make a mistake in your code, you meant to use > > SOCK_STREAM to create a TCP socket. > > Again, this is not my code. But recvfrom is perfectly OK on a dgram > socket. Why ECONNREFUSED? Is this holdover state from the previous sendto? > Is the connect call on a dgram socket putting the socket into a strange > state? 2 possibilities: 1) Nameserver configuration error/default route error 2) You are porting Linux code, like the SLP sample implementation, and you are not doing: sockaddr_in sin; /* * Linux people forget this because their stack pages are zeroed * for "security" reasons. If this is the first time on the * stack, then stack variables will appear zero'ed as well. It * is _wrong_ to depend on this behaviour! */ memset( &sin, 0, sizeof(sin)); Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message