Re: [RFC] Removing most use of #if USE_IPV6 conditional

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Sun, 27 Jun 2010 17:09:01 +0200

sön 2010-06-27 klockan 17:19 +1200 skrev Amos Jeffries:

> At present it means enable/disable IPv6 support in IP::Address, with a
> corollary of also disabling stuff that requires that storage support.

ipv6 address storage is not an issue imho. First of all I very much
doubt we have any target platform not having IPv6 address storage
support, and if we are then adding the needed structs for Squid is not
an issue.

> If you really wished it could be broken down into two, one for disabling
> just connectivity, the other for disabling full storage and up support.

What I am proposing is that we always have IPv6 address storage support,
and consequently always have all code related to that enabled. So just
one for IPv6 connectivity.

> The cases Henrik points to:
>
> * URL parsing - require IPv6 address storage and library support to
> verify its an IP and not "[example.com]"
> ** okay the url.cc ones can all go.
> ** IPv4-only case will end up dying with parsing unable to resolve
> host name "dead::beef" instead of dying with invalid hostname "[dead::beef]"

Why? It's an IPv6 address. Would die with a "Cannot forward" as there is
no IPv4 compatible address..

> * DNS AAAA resolution - requires storage of the AAAA results to be
> worth the extra processing. The only gain in allowing this would be to
> show extra stats to admin of "you could have used IPv6 to get domain X"

I do not really propose that we actually do AAAA lookups, just that the
code is there. But maybe we should..

> * FTP - requires IPv6 connectivity to even advertise EPSV (2) to the
> server. Or the server is liable to respond saying "I am opening a port
> at dead::beef:1"

Which should be conditional on the address type of the control channel,
not USE_IPV6.

> ** the other two (response handling) cases where the IPv6-only code
> is run-time wrapped could go:
> if ( AI->ai_addrlen != sizeof(struct sockaddr_in) )
> if (addr.IsIPv6())

Yes.

> * The UDP and TCP logging module ones can go as run-time wrapped.
> ** if (addr.IsIPv4())
>
> * Some of the SNMP ones are run-time tested. But the rest require v6
> storage types.
>
> Are there any others annoying you Henrik?

Quite likely.

Regards
Henrik
Received on Sun Jun 27 2010 - 15:08:00 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 28 2010 - 12:00:07 MDT