From owner-freebsd-hackers Fri Mar 17 09:59:13 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA01856 for hackers-outgoing; Fri, 17 Mar 1995 09:59:13 -0800 Received: from duality.gnu.ai.mit.edu (!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*!#$%^&*@duality.gnu.ai.mit.edu [18.43.0.236]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id JAA01815 for ; Fri, 17 Mar 1995 09:59:12 -0800 Received: (from mycroft@localhost) by duality.gnu.ai.mit.edu (8.6.10/8.6.10) id MAA28775; Fri, 17 Mar 1995 12:58:49 -0500 Date: Fri, 17 Mar 1995 12:58:49 -0500 Message-Id: <199503171758.MAA28775@duality.gnu.ai.mit.edu> From: "Charles M. Hannum" To: terry@cs.weber.edu Cc: peter@bonkers.taronga.com, hackers@FreeBSD.org, tech-net@NetBSD.ORG Subject: Re: Batch Telnet (Re: diskless and 3Com 509) Sender: hackers-owner@FreeBSD.org Precedence: bulk The message returned is "Connection closed by remote host.", not "Connection closed." And you actually believed that message? It's wrong. if (setjmp(peerdied) == 0) telnet(user); (void) NetClose(net); ExitString("Connection closed by foreign host.\n",1); The code is structured rather poorly. It ought to generate that message where it actually notices that the socket is closed. The problem is clearly that the client is getting a close before it reads the data to be displayed. Not at all. If you actually look at the packets on the wire, you'll see: 1) The client sends a FIN. 2) The server sends some data. 3) The client responds to the data with a RST. tcpdump(8) leaves no doubt that the problem, if any, is in the client. Actually, I misspoke about TCP. The client can close the write side by sending a FIN. However, the telnet client is currently closing both sides of the connection when it gets an EOF on stdin. This is really easy to fix. In fact, I just did it.