]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3321: IPv4 Transport endpoint is not connected
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 31 Aug 2011 10:58:00 +0000 (22:58 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 31 Aug 2011 10:58:00 +0000 (22:58 +1200)
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

index 0c512c0d230acf6840d7b96704eec32bde7ebf38..6dc11447add98b6da0c6668211909ef755a1b940 100644 (file)
@@ -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());