Finalizing source IP version

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 08 Sep 2011 08:51:00 -0600

On 09/08/2011 08:11 AM, Amos Jeffries wrote:
> ------------------------------------------------------------
> revno: 11715
> fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3335
> committer: Amos Jeffries <squid3_at_treenet.co.nz>
> branch nick: trunk
> timestamp: Fri 2011-09-09 02:11:05 +1200
> message:
> Bug 3335: ICAP service is down
> modified:
> src/adaptation/icap/Xaction.cc

> 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;
> + }

Hi Amos,

    IIRC, you have mentioned that already, but I want to stress that
there is something really wrong with our code if the above explicit
SetIPv4() call is necessary for a high-level module opening a
connection. There should be virtually no IP-version specific code in
high-level modules such as ICAP!

Judging by the name of it, it should be getOutgoingAddress()
responsibility to finalize the local source address. However, if that
address is not set for whatever reason, the connection establishing code
in Comm should not just fail but should select the right IP version if a
specific IP version must be selected at that time.

Thank you,

Alex.
Received on Thu Sep 08 2011 - 14:51:29 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 09 2011 - 12:00:03 MDT