From: Amos Jeffries Date: Wed, 16 Jan 2013 07:30:47 +0000 (+1300) Subject: Fix ConnOpener IPv6 awareness X-Git-Tag: SQUID_3_4_0_1~373 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1203020c517cbf67c418b84c3a1e1aa7867fde68;p=thirdparty%2Fsquid.git Fix ConnOpener IPv6 awareness When updating IPv6 support for split-stack one USE_IPV6 wrapper was omitted conversion to the EnabledIpv6 stack auto-detect mechanism. This resulted in IPv6 addresses being mis-converted on split-stack systems or with IPv6 disabled in the kernel and --enable-ipv6 built. The visible symptom is "assert(FALSE)" in Ip::Address::GetAddrInfo(). --- diff --git a/src/comm/ConnOpener.cc b/src/comm/ConnOpener.cc index 0cb62c434a..90ac796e34 100644 --- a/src/comm/ConnOpener.cc +++ b/src/comm/ConnOpener.cc @@ -165,12 +165,10 @@ Comm::ConnOpener::start() /* get a socket open ready for connecting with */ if (temporaryFd_ < 0) { -#if USE_IPV6 /* outbound sockets have no need to be protocol agnostic. */ - if (conn_->remote.IsIPv4()) { + if (!(Ip::EnableIpv6&IPV6_SPECIAL_V4MAPPING) && conn_->remote.IsIPv4()) { conn_->local.SetIPv4(); } -#endif temporaryFd_ = comm_openex(SOCK_STREAM, IPPROTO_TCP, conn_->local, conn_->flags, conn_->tos, conn_->nfmark, host_); if (temporaryFd_ < 0) { doneConnecting(COMM_ERR_CONNECT, 0);