--------------------- PatchSet 5182 Date: 2007/08/07 23:25:10 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Add --with-ipv4-mapped option to support Hybrid-Stack OS - These behave like Dual-Stack but require client programs to handle IPv4-mapping internally themselves. Members: NOTES-IPv6:1.1.2.52->1.1.2.53 configure.in:1.63.2.31->1.63.2.32 include/IPAddress.h:1.1.2.30->1.1.2.31 Index: squid3/NOTES-IPv6 =================================================================== RCS file: /cvsroot/squid-sf//squid3/Attic/NOTES-IPv6,v retrieving revision 1.1.2.52 retrieving revision 1.1.2.53 diff -u -r1.1.2.52 -r1.1.2.53 --- squid3/NOTES-IPv6 7 Aug 2007 12:33:19 -0000 1.1.2.52 +++ squid3/NOTES-IPv6 7 Aug 2007 23:25:10 -0000 1.1.2.53 @@ -1,4 +1,4 @@ -$Id: NOTES-IPv6,v 1.1.2.52 2007/08/07 12:33:19 amosjeffries Exp $ +$Id: NOTES-IPv6,v 1.1.2.53 2007/08/07 23:25:10 amosjeffries Exp $ NP: Any problems with this version of squid please contact squid3@treenet.co.nz for assistance. @@ -19,6 +19,11 @@ bothered by the localhost vagaries. It will enable logics to map all localhost traffic through ::1 unless an IPv4-only link is required. + --with-ipv4-mapped option is provided for semi-dual OS that do not do accept raw IPv4 + addresses to IPv6 sockets, but require the client to do all the v4-mapping itself. + This is now considered unsafe by the industry and breaks protocol-independance. + It is not intended to be used unless absolutely necessary. + IPv6 LIMITS: Index: squid3/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid3/configure.in,v retrieving revision 1.63.2.31 retrieving revision 1.63.2.32 diff -u -r1.63.2.31 -r1.63.2.32 --- squid3/configure.in 4 Aug 2007 12:11:27 -0000 1.63.2.31 +++ squid3/configure.in 7 Aug 2007 23:25:10 -0000 1.63.2.32 @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.63.2.31 2007/08/04 12:11:27 amosjeffries Exp $ +dnl $Id: configure.in,v 1.63.2.32 2007/08/07 23:25:10 amosjeffries Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.63.2.31 $)dnl +AC_REVISION($Revision: 1.63.2.32 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1812,6 +1812,12 @@ AC_DEFINE(USE_IPV6_SPLITSTACK, 0, [No support for split-stack IPv6 Implementations]) ) +AC_ARG_WITH(ipv4-mapped, + [ --with-ipv4-mapped Hybrid-Stack OS require Squid to do any v4-mapping (Requires IPv6 Support)], + AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 1, [Perform v4-mapping Internally]) , + AC_DEFINE(IPV6_SPECIAL_V4MAPPING, 0, [Leave v4-mapping to OS Implementation]) +) + AC_ARG_WITH(localhost-ipv6, [ --with-localhost-ipv6 Prefer IPv6 localhost address over IPv4 (Requires IPv6 Support). Treats 127.0.0.1 and ::1 as identical and converts all inputs of to ::1 @@ -1841,14 +1847,18 @@ [ AC_DEFINE(USE_IPV6,1,[Enable support for IPv6 ]) AC_MSG_RESULT(yes) ], - [ AC_DEFINE(USE_IPV6_SPLITSTACK,0,[Disable support for Split-Stack IPv6 Implementations]) - AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) + [ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) + AC_DEFINE(USE_IPV6_SPLITSTACK,0,[Disable support for Split-Stack IPv6 Implementations]) + AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Keep IPv4 and IPv6 Localhosts seperate.]) + AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[Leave v4-mapping to OS Implementation]) AC_MSG_RESULT(no) ]) ) ], -[ AC_DEFINE(USE_IPV6_SPLITSTACK,0,[Disable support for Split-Stack IPv6 Implementations]) - AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) +[ AC_DEFINE(USE_IPV6,0,[Disable support for IPv6]) + AC_DEFINE(USE_IPV6_SPLITSTACK,0,[Disable support for Split-Stack IPv6 Implementations]) + AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Keep IPv4 and IPv6 Localhosts seperate.]) + AC_DEFINE(IPV6_SPECIAL_V4MAPPING,0,[Leave v4-mapping to OS Implementation]) AC_MSG_RESULT(no) ]) Index: squid3/include/IPAddress.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/Attic/IPAddress.h,v retrieving revision 1.1.2.30 retrieving revision 1.1.2.31 diff -u -r1.1.2.30 -r1.1.2.31 --- squid3/include/IPAddress.h 5 Aug 2007 23:25:23 -0000 1.1.2.30 +++ squid3/include/IPAddress.h 7 Aug 2007 23:25:12 -0000 1.1.2.31 @@ -1,6 +1,6 @@ /* - * $Id: IPAddress.h,v 1.1.2.30 2007/08/05 23:25:23 amosjeffries Exp $ + * $Id: IPAddress.h,v 1.1.2.31 2007/08/07 23:25:12 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -310,14 +310,21 @@ * the caller MUST override these default settings. * Some situations may also require an actual call to the system getaddrinfo() * to pull relevant OS details for the socket. - * - * IPAddress allocated objects MUST be estructed by IPAddress::FreeAddrInfo + *\par + * IPAddress allocated objects MUST be destructed by IPAddress::FreeAddrInfo * System getaddrinfo() allocated objects MUST be freed with system freeaddrinfo() + *\par + * Some OS require that IPv4 addresses are pre-mapped by the client. + * The configure option --with-ipv4-mapping=yes will enable this. * * \param ai structure to be filled out. * \param force a specific sockaddr type is needed. default: don't care. */ +#if IPV6_SPECIAL_V4MAPPING + void GetAddrInfo(struct addrinfo *&ai, int force = AF_INET6) const; +#else void GetAddrInfo(struct addrinfo *&ai, int force = AF_UNSPEC) const; +#endif /** * Equivalent to the sysem call freeaddrinfo() but for IPAddress allocated data