]> git.ipfire.org Git - thirdparty/squid.git/commit
author: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3...
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Sun, 7 Aug 2011 10:26:09 +0000 (13:26 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Sun, 7 Aug 2011 10:26:09 +0000 (13:26 +0300)
commit0906f01de4bde8fa30a5c94b235cf74a4f8c9400
tree2db0fdaeb9f783c0eed291d9a6e876b41f484b35
parent21e543593103b9fec2dcae254be790f60da98737
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
src/ip/Address.cc
src/ip/Address.h