# HG changeset patch # User al # Date 1373580513 0 # Node ID a2750366a2552fa660d5d2828989ccf1edb42087 # Parent c5b20369f0be7351e78ffba547b95c3f7cb3f4be stream/tcp: Check that host object has the right AF before connect Avoid trying bogus IPv6 adresses on systems that only have gethostbyname function. Currently we would copy the IPv4 address into the first part of the IPv6 and then try to connect to that. The connection attempt can take a long time. Tested-by: Erik Auerswald >auerswal unix-ag uni-kl de< Patch-by: >aplattner nvidia com< diff -r c5b20369f0be -r a2750366a255 stream/tcp.c --- a/stream/tcp.c Thu Jul 11 15:27:32 2013 +0000 +++ b/stream/tcp.c Thu Jul 11 22:08:33 2013 +0000 @@ -160,6 +160,8 @@ return TCP_ERROR_FATAL; } + if (af != hp->h_addrtype) return TCP_ERROR_FATAL; + memcpy( our_s_addr, hp->h_addr_list[0], hp->h_length ); } #if HAVE_WINSOCK2_H