Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2003 23:08:59 -0400
From:      Barney Wolff <barney@pit.databus.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        current@freebsd.org
Subject:   Re: connect(2) behavior with unreacheable hosts
Message-ID:  <20030413030859.GB64896@pit.databus.com>
In-Reply-To: <20030412.210042.104160257.imp@bsdimp.com>
References:  <109.225ca595.2bc723f2@aol.com> <20030412.204912.76964336.imp@bsdimp.com> <20030412.210042.104160257.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 12, 2003 at 09:00:42PM -0600, M. Warner Losh wrote:
> I just read the rest of the thread:
> 
> 1) route loops don't matter.  connect should timeout after a while,
>    and on stable it is like 75 seconds.  loop elsewhere doesn't matter
>    because it is the same thing as a black hole.  You don't get the
>    handshake back, you timeout.  Doesn't matter why (and the sending
>    host can't tell them apart).
> 2) This is clearly TCP.
> 3) telnet 1.2.3.4 does the following bogusly:
> 	Trying 1.2.3.4...
> 	Connected to 1.2.3.4.
> 	Escape character is '^]'.
> 	Connection closed by foreign host.
> 
> All the lines are printed in < 1s.
> 
> However, this may be because I live behind a NAT box.  Any chance you
> did your testing in a similar environment, which is causing your
> confusion.  On my non-NAT'd boxes, this works as expected.

The catch is that connecting to 1.2.3.4 behaves differently depending
on whether:
1.  ICMP host-unreach
2.  Nothing at all
3.  ICMP time-exceeded
comes back.  The first two cases are handled correctly, the third is not.

-- 
Barney Wolff         http://www.databus.com/bwresume.pdf
I'm available by contract or FT, in the NYC metro area or via the 'Net.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030413030859.GB64896>