From 48c7e84b320b5219d76e4893a977490ccbbd037e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 31 Aug 2011 22:58:00 +1200 Subject: [PATCH] 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. --- src/peer_select.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()); -- 2.47.2