author: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3@treenet.co.nz>
Bug fix: The Ip::Address::IsAnyAddr method return false for IPv4 anyaddr.
- The ip::Address::IsAnyAddr() returns true only for ipv6 anyaddr
(0000:0000:0000:0000:0000:0000:0000:0000) and returns false when we have an
ipv4 anyaddr (0000:0000:0000:0000:0000:FFFF:0000:0000)
- The ip::Address::IsIPv4 method returns false in the case of IPv4 anyaddr.
The above can cause bugs, eg:
- inside Ip::Address::SetIPv4(). When it is called for an IPv6 anyaddr the ip
address will not considred as anyaddr any morei (it IsAnyAddr will return
false).
- inside cache_cf.cc file inside dump_generic_http_port function:
if (s->s.IsAnyAddr() && !s->s.IsIPv6())
storeAppendPrintf(e, " ipv4");
The if condition in the above statement can never be true. But the s->s can
be an ipv4 anyaddr.
- other places where the code will not work as expected in the case we are
listening to an ipv4 anyaddr ip address.
This patch:
- moving the IsIPv4/6 to base purely on the v4-mapped or not
- making both protocols ANYADDR match the same test
- making both protocols NOADDR match the same test
- Fixing the IsIPv4/6 documentation to match the implementation