From owner-freebsd-net@FreeBSD.ORG Fri Apr 11 10:14:25 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE9A237B401; Fri, 11 Apr 2003 10:14:25 -0700 (PDT) Received: from imo-r07.mx.aol.com (imo-r07.mx.aol.com [152.163.225.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE80E43F3F; Fri, 11 Apr 2003 10:14:24 -0700 (PDT) (envelope-from BelletJr@aol.com) Received: from BelletJr@aol.com by imo-r07.mx.aol.com (mail_out_v34.21.) id d.1dc.74b8b15 (3310); Fri, 11 Apr 2003 13:14:15 -0400 (EDT) From: BelletJr@aol.com Message-ID: <1dc.74b8b15.2bc851e7@aol.com> Date: Fri, 11 Apr 2003 13:14:15 EDT To: tlambert2@mindspring.com MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: AOL 5.0 for Windows sub 116 cc: current@freebsd.org cc: net@freebsd.org Subject: Re: connect(2) behavior with unreacheable hosts X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 17:14:26 -0000 >Dans un e-mail dat=E9 du 11/04/03 00:23:16 Paris, Madrid (Heure d'=E9t=E9),= =20 tlambert2@mindspring.com a =E9crit : > >BelletJr@aol.com wrote: >> 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= =20 and >> the value 0 is returned by connect(2). >> My test was done with TCP/IPv4. > >Because it can't detect an infinite routing loop. Then why can't it detect an infinite routing loop? :) It does not implement=20 the classic three-way handshake of a TCP connection establishment?? If this is the case, I think the man page is not precise enough. It states=20 "If the socket is of type SOCK_STREAM, this call attempts to make a=20 connection to another socket" and later on "The connect() function returns=20 the value 0 if successful". BTW we can imagine that the majority of programs aren't crafted to handle=20 this case. Have a look for example to the simple "daytime.c" program from th= e=20 developper handbook. It just doesn't do anything if time.nist.gov is=20 unreachable because of an infinite routing loop. Jerome