------------------------------------------------------------ revno: 13863 revision-id: squid3@treenet.co.nz-20150716070137-l130moshh3wk96eg parent: squid3@treenet.co.nz-20150716070012-sgalrl71wps83uss committer: Amos Jeffries branch nick: 3.5 timestamp: Thu 2015-07-16 00:01:37 -0700 message: IPv6: improve BCP 177 compliance Always perform the IP transport probes to detect IPv6 availability. * Accept lack of IPv6 assignment as per normal by auto-disabling IPv6. * Whine loudly if (and only if) it would have worked but has been forced OFF by --disable-ipv6. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20150716070137-l130moshh3wk96eg # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 91282a68ed8d3e43745e80ddcab83939676e9455 # timestamp: 2015-07-16 07:16:05 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20150716070012-\ # sgalrl71wps83uss # # Begin patch === modified file 'src/ip/tools.cc' --- src/ip/tools.cc 2015-01-13 09:13:49 +0000 +++ src/ip/tools.cc 2015-07-16 07:01:37 +0000 @@ -30,7 +30,6 @@ void Ip::ProbeTransport() { -#if USE_IPV6 // check for usable IPv6 sockets int s = socket(PF_INET6, SOCK_STREAM, 0); if (s < 0) { @@ -56,12 +55,18 @@ debugs(3, 2, "Missing RFC 3493 compliance - attempting split IPv4 and IPv6 stacks ..."); EnableIpv6 |= IPV6_SPECIAL_SPLITSTACK; #endif + // TODO: attempt to use the socket to connect somewhere ? + // needs to be safe to contact and with guaranteed working IPv6 at the other end. close(s); +#if USE_IPV6 debugs(3, 2, "IPv6 transport " << (EnableIpv6?"Enabled":"Disabled")); #else - debugs(3, 2, "IPv6 transport forced OFF by build parameters."); - EnableIpv6 = IPV6_OFF; + debugs(3, 2, "IPv6 transport " << (EnableIpv6?"Available":"Disabled")); + if (EnableIpv6 != IPV6_OFF) { + debugs(3, DBG_CRITICAL, "WARNING: BCP 177 violation. IPv6 transport forced OFF by build parameters."); + EnableIpv6 = IPV6_OFF; + } #endif }