From: Amos Jeffries Date: Wed, 31 Aug 2011 10:58:00 +0000 (+1200) Subject: Bug 3321: IPv4 Transport endpoint is not connected X-Git-Tag: take08~33^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48c7e84b320b5219d76e4893a977490ccbbd037e;p=thirdparty%2Fsquid.git Bug 3321: IPv4 Transport endpoint is not connected Match outgoing wildcard IP family to destination In SMP mode the socket opening only considers local IP. Ensure this will match the destination IP even when outgoing IP is unset. --- diff --git a/src/peer_select.cc b/src/peer_select.cc index 0c512c0d23..6dc11447ad 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -279,7 +279,13 @@ peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, v // check for a configured outgoing address for this destination... getOutgoingAddress(psstate->request, p); - psstate->paths->push_back(p); + if (p->remote.IsIPv4() && !p->local.SetIPv4()) { + // This should never happen. getOutgoing should match by family or skip. + assert(p->local.IsAnyAddr()); + continue; + } else { + psstate->paths->push_back(p); + } } } else { debugs(44, 3, HERE << "Unknown host: " << fs->_peer ? fs->_peer->host : psstate->request->GetHost());