connect(2) behavior with unreacheable hosts
Barney Wolff
barney at pit.databus.com
Sat Apr 12 20:09:03 PDT 2003
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.
More information about the freebsd-current
mailing list