Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2003 13:14:15 EDT
From:      BelletJr@aol.com
To:        tlambert2@mindspring.com
Cc:        net@freebsd.org
Subject:   Re: connect(2) behavior with unreacheable hosts
Message-ID:  <1dc.74b8b15.2bc851e7@aol.com>

index | next in thread | raw e-mail

>Dans un e-mail daté du 11/04/03 00:23:16 Paris, Madrid (Heure d'été), 
tlambert2@mindspring.com a écrit :
>
>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 
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 
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 
"If the socket is of type SOCK_STREAM, this call attempts to make a 
connection to another socket" and later on "The connect() function returns 
the value 0 if successful".

BTW we can imagine that the majority of programs aren't crafted to handle 
this case. Have a look for example to the simple "daytime.c" program from the 
developper handbook. It just doesn't do anything if time.nist.gov is 
unreachable because of an infinite routing loop.

Jerome


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1dc.74b8b15.2bc851e7>