IPv6 support roadmap

Usage
Although the global transition to IPv6 is coming very slowly, it will be necessary to support the new IP format in the future. MediaWiki will require changes to IP.php and some of the block/checkuser code. Possible schema changes are likely to get the indexing to work well in the future.

Current code
A number of functions have been added for IPv6 support for blocks:
 * - expands IPs and set them to all-caps
 * - creates an IPv6 octet from an integer

Additionally, there are some new validation functions which use some IPv6 validation regexps:

Some of the current functions for IPv4 now check for IPv6 IPs and return output from the correct function if an IPv6 IP is given. Additionally, the IPv6 ones all avoid the use of native bit functions and operations due to their 32 bit limits. Using them will cause garbage or invalid output.

Todo

 * More unit tests!
 * Deal with proper CIDR defaults for blocks

Normalization/storage issues
As of MW 1.11, all user and user talk pages for IPv6 IPs are normalized. This is due to the fact that given user of upper/lower case, '::' usage, and other permutations, there are many different ways to represent the same IP.

For consistency,  should be used when storing and checking against IPs in the database. This function expands "::" abbreviations, removes leading bloc zeroes, and sets to all caps IPv6 addresses (other addresses or strings are return as is).

However the issue of indexing and performance remains. Currently, we have:

In tables.sql.

This is problematic as IPv6 addresses, when padded out, are 32 characters, rather than 8 for IPv4. This partial index will likely be fine for a long time, as there are few range blocks, usually they are not permanent, and few are IPv6.

Deployments
As of 2011, MediaWiki has been deployed using IPv6 on a number of existing third-party sites such as ipv6wiki.net [2600:3c01::f03c:91ff:fe93:a08d], en.linuxreviews.org [2001:470:1f0b:1c12::4] and cgwiki.comicgenesis.com [2001:470:1:3a::14]. ARIN operates its own IPv6 Wiki as www.getipv6.info [2001:500:4:13::89].

Note that use of Squid or Varnish caching will require those applications also be implemented using current, IPv6-aware versions and configured to indicate both IPv4 and IPv6 addresses to be used. IPv6 support is enabled by default in Squid-3.1 per http://wiki.squid-cache.org/Features/IPv6 and is also available in Varnish.