]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3335: ICAP service is down
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Sep 2011 14:11:05 +0000 (02:11 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 8 Sep 2011 14:11:05 +0000 (02:11 +1200)
src/adaptation/icap/Xaction.cc

index 4a13a596c34991cd3af072d088ed291aea84eac3..1f2d4f935ac3dccfc086a3a87094d7cd26e888a3 100644 (file)
@@ -161,6 +161,11 @@ Adaptation::Icap::Xaction::dnsLookupDone(const ipcache_addrs *ia)
     connection->remote = ia->in_addrs[ia->cur];
     connection->remote.SetPort(s.cfg().port);
     getOutgoingAddress(NULL, connection);
+    if (connection->remote.IsIPv4() && !connection->local.SetIPv4()) {
+        // This should never happen. getOutgoing should match by family or skip.
+        Must(connection->local.IsAnyAddr());
+        return;
+    }
 
     // TODO: service bypass status may differ from that of a transaction
     typedef CommCbMemFunT<Adaptation::Icap::Xaction, CommConnectCbParams> ConnectDialer;