From owner-freebsd-current@FreeBSD.ORG Sat Apr 12 20:05:05 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2C4B37B401 for ; Sat, 12 Apr 2003 20:05:05 -0700 (PDT) Received: from pit.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id D585343FA3 for ; Sat, 12 Apr 2003 20:05:04 -0700 (PDT) (envelope-from barney@pit.databus.com) Received: from pit.databus.com (localhost [127.0.0.1]) by pit.databus.com (8.12.9/8.12.9) with ESMTP id h3D350dN065114; Sat, 12 Apr 2003 23:05:00 -0400 (EDT) (envelope-from barney@pit.databus.com) Received: (from barney@localhost) by pit.databus.com (8.12.9/8.12.9/Submit) id h3D3501Y065113; Sat, 12 Apr 2003 23:05:00 -0400 (EDT) Date: Sat, 12 Apr 2003 23:05:00 -0400 From: Barney Wolff To: "M. Warner Losh" Message-ID: <20030413030500.GA64896@pit.databus.com> References: <109.225ca595.2bc723f2@aol.com> <20030412.204912.76964336.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030412.204912.76964336.imp@bsdimp.com> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) cc: current@freebsd.org Subject: Re: connect(2) behavior with unreacheable hosts X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2003 03:05:06 -0000 On Sat, Apr 12, 2003 at 08:49:12PM -0600, M. Warner Losh wrote: > In message: <109.225ca595.2bc723f2@aol.com> > BelletJr@aol.com writes: > : Why does not connect(2) return any error when trying to connect to a host > : unreachable because of an infinite loop in the routes? No time-out occurs and > : the value 0 is returned by connect(2). > > Hmmmmm, you are correct. I was sure that you were nuts, but on > -current the following program returns no error at all... Telnet > shows the same behavior. This is clearly wrong. It's not just current; stable behaves exactly the same. The problem is that the icmp time-exceeded packet gets translated into an error code of 0, which confuses things. I've filed a PR with a suggested fix: http://www.freebsd.org/cgi/query-pr.cgi?pr=50839 -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net.