connect(2) behavior with unreacheable hosts

Barney Wolff barney at pit.databus.com
Thu Apr 10 13:56:09 PDT 2003


On Thu, Apr 10, 2003 at 03:45:54PM -0400, BelletJr at 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.

By any chance, are you using UDP (SOCK_DGRAM) rather than TCP (SOCK_STREAM)?
That sets up data structures but sends no packets, so even if an icmp
time-exceeded will be returned when you do send packets, the problem
can't be detected yet.

-- 
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