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

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sat, 26 Jun 2010 14:22:00 -0600

On 06/26/2010 02:26 AM, Henrik Nordström wrote:
> I'd like to see most uses of the USE_IPV6 conditional removed, limiting
> it to just the parts dealing with IPv6 networking.

In other words, define USE_IPV6 as "use IPv6 addresses in system calls"?
 And currently it is defined as "handle IPv6 addresses in URLs and use
IPv6 addresses in system calls"? +1. Just document what USE_IPV6 means.

Cheers,

Alex.

> Having conditionals sprinkled out over the code is bad, and even badder
> if the conditional isn't really needed. The basic "IPv6" functionality
> like being able to parse IPv6 URLs, ACLs and even AAAA lookups (for ACL
> processing) all works perfectly fine even in an IPv4-only setup.
>
> Removing this artificial limit from our code will add two things:
>
> a) We get less conditional code which means less risk for things
> bitrotting etc.
>
> b) Users gets another smooth option for IPv6 transition as their
> IPv4-only Squids will be perfectly capable of forwarding requests to an
> IPv6 enabled proxy, something which we aren't really capable of today
> due to even the URL parser being IPv4/IPv6 dependent..
>
> What we loose is the binary size reduction when IPv6 is disabled, but
> given that this size reduction is relatively small, only marginally
> performance related and also subtly disabling use cases not dependent on
> IPv6 support I do not think size optimization by completely removing
> everything related to IPv6 is a desirable goal.
>
> Quite many of these conditionals can be removed straight away with no
> code changes other than removing the conditional.
Received on Sat Jun 26 2010 - 20:22:52 MDT

This archive was generated by hypermail 2.2.0 : Sun Jun 27 2010 - 12:00:10 MDT